mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 10:01:14 -03:00
Rework exit command
Prior to this fix, the `exit` command would set a global variable in the reader, which parse_execution would check. However in concurrent mode you may have multiple scripts being sourced at once, and 'exit' should only apply to the current script. Switch to using a variable in the parser's libdata instead.
This commit is contained in:
@@ -182,11 +182,19 @@ struct library_data_t {
|
||||
bool suppress_fish_trace{false};
|
||||
|
||||
/// Whether we should break or continue the current loop.
|
||||
/// This is set by the 'break' and 'continue' commands.
|
||||
enum loop_status_t loop_status { loop_status_t::normals };
|
||||
|
||||
/// Whether we should return from the current function.
|
||||
/// This is set by the 'return' command.
|
||||
bool returning{false};
|
||||
|
||||
/// Whether we should stop executing.
|
||||
/// This is set by the 'exit' command, and unset after 'reader_read'.
|
||||
/// Note this only exits up to the "current script boundary." That is, a call to exit within a
|
||||
/// 'source' or 'read' command will only exit up to that command.
|
||||
bool exit_current_script{false};
|
||||
|
||||
/// The read limit to apply to captured subshell output, or 0 for none.
|
||||
size_t read_limit{0};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user