mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-26 02:51:16 -03:00
Fix status when function/block evaluation is cancelled
It looks like the last status already contains the signal that cancelled execution. Also make `fish -c something` always return the last exit status of "something", instead of hardcoded 127 if exited or signalled. Fixes #6444
This commit is contained in:
@@ -737,10 +737,8 @@ static proc_performer_t get_performer_for_process(process_t *p, const job_t *job
|
||||
switch (res) {
|
||||
case eval_result_t::ok:
|
||||
case eval_result_t::error:
|
||||
return proc_status_t::from_exit_code(parser.get_last_status());
|
||||
case eval_result_t::cancelled:
|
||||
// TODO: we should reflect the actual signal which was received.
|
||||
return proc_status_t::from_signal(SIGINT);
|
||||
return proc_status_t::from_exit_code(parser.get_last_status());
|
||||
case eval_result_t::control_flow:
|
||||
default:
|
||||
DIE("eval_result_t::control_flow should not be returned from eval_node");
|
||||
@@ -768,11 +766,8 @@ static proc_performer_t get_performer_for_process(process_t *p, const job_t *job
|
||||
? EXIT_SUCCESS
|
||||
: parser.get_last_status());
|
||||
case eval_result_t::error:
|
||||
return proc_status_t::from_exit_code(parser.get_last_status());
|
||||
|
||||
case eval_result_t::cancelled:
|
||||
// TODO: we should reflect the actual signal which was received.
|
||||
return proc_status_t::from_signal(SIGINT);
|
||||
return proc_status_t::from_exit_code(parser.get_last_status());
|
||||
default:
|
||||
case eval_result_t::control_flow:
|
||||
DIE("eval_result_t::control_flow should not be returned from eval_node");
|
||||
|
||||
Reference in New Issue
Block a user