39c573e97f020642db4622d21bdc085c6e88d648 — Simon Ser 29 days ago 2443192
Restore signal handlers in subshells
1 files changed, 10 insertions(+), 1 deletions(-)

M shell/shell.c
M shell/shell.c => shell/shell.c +10 -1
@@ 189,6 189,12 @@ exit(1);
  			}
  			ctx->job = job_create(ctx->state, pgid);
+ 
+ 			if (ctx->state->interactive && !ctx->background) {
+ 				job_set_foreground(ctx->job, true, false);
+ 			}
+ 
+ 			init_job_child_process(ctx->state);
  		}
  
  		return 0;


@@ 205,9 211,12 @@ return false;
  		}
  
- 		// Create a background job
  		struct mrsh_job *job = job_create(ctx->state, pgid);
  		job_add_process(job, proc);
+ 
+ 		if (ctx->state->interactive && !ctx->background) {
+ 			job_set_foreground(job, true, false);
+ 		}
  	}
  
  	return pid;