Save the screen status after running command bindings

This concerns running a key binding which invokes a command. If that
command modifies the tty, then fish will spot the modification later and
then react to it by redrawing the prompt. However tty modifications may
be benign or desirable; for example switching the cursor from a line to
a block. Fix this by re-fstating the tty after running external
commands.

Fixes #3481
This commit is contained in:
ridiculousfish 2022-06-06 11:47:27 -07:00
parent 49567a060e
commit b8ad117e87
2 changed files with 5 additions and 0 deletions

View file

@ -89,6 +89,7 @@ Interactive improvements
- ``time`` now emits an error if used after the first command in a pipeline (:issue:`8841`).
- ``fish_add_path`` now prints a message for skipped non-existent paths when using the ``-v`` flag.
- Since fish 3.2.0, pressing :kbd:`Control-D` while a command is running would end up inserting a space into the next commandline, which has been fixed (:issue:`8871`).
- A bug that caused multi-line prompts to be moved down a line when switching between insert and normal mode has been fixed (:issue:`3481`).
New or improved bindings
^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -3079,6 +3079,10 @@ void reader_data_t::run_input_command_scripts(const wcstring_list_t &cmds) {
wperror(L"tcsetattr");
}
termsize_container_t::shared().invalidate_tty();
// The input command scripts may have changed our tty - ignore any such changes.
// See #3481.
screen.save_status();
}
/// Read normal characters, inserting them into the command line.