Notice when exit has been run from within fish_prompt

This allows `exit` to tell the reader to stop, when run inside
fish_prompt. Fixes #8033.
This commit is contained in:
ridiculousfish 2021-06-12 10:19:58 -07:00
parent 9e46d49dd9
commit ba2e7db7e8
2 changed files with 5 additions and 0 deletions

View file

@ -51,6 +51,7 @@ Interactive improvements
- fish now tries to find a Unicode-aware locale for encoding (``LC_CTYPE``) if started without any locale information, improving the display of emoji and other non-ASCII text on misconfigured systems (:issue:`8031`). To allow a C locale, set the variable ``fish_allow_singlebyte_locale`` to 1.
- The Web-based configuration and documentation now feature a dark mode if the browser requests it (:issue:`8043`).
- Color variables can now also be given like ``--background red`` and ``-b red``, not just ``--background=red`` (:issue:`8053`).
- ``exit`` run within ``fish_prompt`` now exits properly (:issue:`8033`).
New or improved bindings
^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1313,6 +1313,10 @@ void reader_data_t::exec_prompt() {
// may still be output on the line from the previous command (#2499) and we need our PROMPT_SP
// hack to work.
reader_write_title(L"", parser(), false);
// Some prompt may have requested an exit (#8033).
this->exit_loop_requested |= parser().libdata().exit_current_script;
parser().libdata().exit_current_script = false;
}
void reader_init() {