2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-02-14 04:58:33 +00:00
fish-shell/src
Johannes Altmanninger 99bf3d0dbb Fix imbalanced terminal protocols on SIGCHLD
We enable terminal protocols once at startup, and disable them before exit.
Additionally, we disable them while evaluating commands (see 8164855b7 (Disable
terminal protocols throughout evaluation, 2024-04-02))..

Thirdly, we re-enable protocols inside builtin read (where it's disabled
because we are evaluating something).  All of these three are scoped and
statically guaranteed to not leak into each others scopes.

There is another place where we enable protocols non-scoped: when we
receive a notification that a job is stopped. If this is ever hit, things
will be imbalanced and we'll fail to restore the right terminal state,
or (more likely) crash due the assertion in terminal_protocols_enable().
This code path used to be necessary when we disabled protocols only while
actually executing an external command but we changed that in 8164855b7,
so it should no longer be.  Remove it.

I haven't been able to find a test case, I'll try to do that later.

The main reason we changed the scope of protocols was focus reporting ().
We have given up on that for now (outside tmux where I can't get it to work)
so we might want to reconsider and go back to the "optimized" approach of
enabling it for as long as possible. But this is simpler, easier to verify.
2024-04-21 17:16:23 +02:00
..
bin fish_key_reader: use canonical key name for ctrl-{c,d} 2024-04-20 12:11:30 +02:00
builtins Deprecate builtin test's one- and zero-argument modes () 2024-04-21 14:25:54 +02:00
env Update commandline state snapshot lazily 2024-04-13 14:36:11 +02:00
fork_exec Remove using statements already imported by preludes 2024-02-28 09:41:51 -06:00
history Use File instead of OwnedFd in a few places () 2024-03-17 11:20:44 -05:00
tests Escape : and = in file completions 2024-04-20 13:34:08 +02:00
universal_notifier Move from libc read/write to nix read/write 2024-01-21 11:49:40 -08:00
widecharwidth Move fish-rust to project root 2024-01-13 03:58:33 +01:00
wutil Do not insert key's PUA encoding into the command line 2024-04-09 00:46:16 +02:00
abbrs.rs Make test_init() return a scope guard 2024-03-24 16:33:35 +01:00
ast.rs Make test_init() return a scope guard 2024-03-24 16:33:35 +01:00
autoload.rs Make test_init() return a scope guard 2024-03-24 16:33:35 +01:00
color.rs Fix some clippy warnings 2024-01-21 19:12:33 -08:00
common.rs Escape : and = in file completions 2024-04-20 13:34:08 +02:00
complete.rs Escape : and = in file completions 2024-04-20 13:34:08 +02:00
curses.rs curses: Remove f13-f20 2024-04-02 21:33:54 +02:00
editable_line.rs Fix restoring cursor position on redo with edit groups 2024-04-13 14:36:11 +02:00
env_dispatch.rs Set terminal title unconditionally 2024-04-02 14:35:16 +02:00
env_universal_common.rs Don't leak encoding of invalid codepoints into uvar file 2024-04-14 07:59:42 +02:00
event.rs Remove L! from sprintf calls 2024-01-13 08:52:54 +01:00
exec.rs Disable terminal protocols throughout evaluation 2024-04-02 21:25:47 +02:00
expand.rs Add feature flag to turn off %self () 2024-02-06 22:13:16 +01:00
fallback.rs Use File instead of OwnedFd in a few places () 2024-03-17 11:20:44 -05:00
fd_monitor.rs Remove using statements already imported by preludes 2024-02-28 09:41:51 -06:00
fd_readable_set.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
fds.rs Make test_init() return a scope guard 2024-03-24 16:33:35 +01:00
fish_test_helper.cpp test_helper: Give self-signalling a chance to trigger 2024-03-19 16:41:25 +01:00
flog.rs Deprecate builtin test's one- and zero-argument modes () 2024-04-21 14:25:54 +02:00
function.rs Remove using statements already imported by preludes 2024-02-28 09:41:51 -06:00
future.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
future_feature_flags.rs Deprecate builtin test's one- and zero-argument modes () 2024-04-21 14:25:54 +02:00
global_safety.rs Simplify shared-from-this pattern 2024-03-09 10:09:03 +01:00
highlight.rs Add <? input redirection 2024-04-21 14:35:13 +02:00
history.rs Make history::remove take a &wstr instead of a WString 2024-04-15 09:47:46 -07:00
input.rs Allow mapping new-style sequences that start with escape 2024-04-15 09:20:44 +02:00
input_common.rs Fix imbalanced terminal protocols on SIGCHLD 2024-04-21 17:16:23 +02:00
io.rs Add <? input redirection 2024-04-21 14:35:13 +02:00
job_group.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
key.rs Match stdlib strip_prefix return value 2024-04-20 13:34:08 +02:00
kill.rs Remove L! from sprintf calls 2024-01-13 08:52:54 +01:00
lib.rs Extended & human-friendly keys 2024-04-02 14:35:16 +02:00
libc.c Switch to the terminfo crate 2024-02-22 20:10:16 +01:00
libc.rs Remove uses of LC_GLOBAL_LOCALE 2024-02-01 22:15:24 +01:00
locale.rs Remove uses of LC_GLOBAL_LOCALE 2024-02-01 22:15:24 +01:00
nix.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
null_terminated_array.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
operation_context.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
output.rs Emit OSC 133 sequences to mark prompt/command output regions 2024-04-06 22:22:56 +02:00
pager.rs History pager to only operate on the line at cursor 2024-03-23 09:54:18 +01:00
panic.rs Print panic message to stderr, like the stack trace 2024-04-02 07:34:19 +02:00
parse_constants.rs Remove L! from sprintf calls 2024-01-13 08:52:54 +01:00
parse_execution.rs Forbid subcommand keywords in variables-as-commands () 2024-02-06 22:12:55 +01:00
parse_tree.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
parse_util.rs Teach fish_indent to only indent and unindent 2024-04-15 08:32:31 +02:00
parser.rs Clean up log statement 2024-04-06 11:22:19 +02:00
parser_keywords.rs Remove widestring-suffix uses 2024-01-13 08:52:54 +01:00
path.rs Fix build on NetBSD () 2024-01-28 21:45:14 +01:00
pointer.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
print_help.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
proc.rs Fix imbalanced terminal protocols on SIGCHLD 2024-04-21 17:16:23 +02:00
re.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
reader.rs Do not treat \: or \= as file completion anchor 2024-04-20 13:34:08 +02:00
reader_history_search.rs shift-delete to delete current history search match 2024-04-13 20:23:51 +02:00
redirection.rs Add <? input redirection 2024-04-21 14:35:13 +02:00
screen.rs Add special_key=1 to prompt marking 2024-04-07 09:59:09 +02:00
signal.rs Pop CSI u mode on SIGTERM 2024-04-07 13:32:48 +02:00
termsize.rs Move termsize test into separate file 2024-03-24 12:18:20 +01:00
threads.rs Address clippy lints 2024-03-09 13:49:25 +01:00
timer.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
tinyexpr.rs Remove widestring-suffix uses 2024-01-13 08:52:54 +01:00
tokenizer.rs Add <? input redirection 2024-04-21 14:35:13 +02:00
topic_monitor.rs Use OwnedFd in AutoClosePipes 2024-02-11 11:40:27 -08:00
trace.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
util.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
wait_handle.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
wchar.rs Remove widestring-suffix uses 2024-01-13 08:52:54 +01:00
wchar_ext.rs Match stdlib strip_prefix return value 2024-04-20 13:34:08 +02:00
wcstringutil.rs remove repetitive words () 2024-03-07 18:35:41 -06:00
wgetopt.rs Reimplement WGetopter::exchange() using rotate_left 2024-04-17 12:41:16 -07:00
wildcard.rs remove repetitive words () 2024-03-07 18:35:41 -06:00