mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-25 23:21:15 -03:00
Fix for errant SIGHUPs due to child fish shells messing with the term.
Fixes https://github.com/fish-shell/fish-shell/issues/1002
This commit is contained in:
10
reader.cpp
10
reader.cpp
@@ -993,10 +993,18 @@ void reader_init()
|
||||
|
||||
void reader_destroy()
|
||||
{
|
||||
tcsetattr(0, TCSANOW, &terminal_mode_on_startup);
|
||||
pthread_key_delete(generation_count_key);
|
||||
}
|
||||
|
||||
void restore_term_mode()
|
||||
{
|
||||
// Restore the term mode if we own the terminal
|
||||
// It's important we do this before restore_foreground_process_group, otherwise we won't think we own the terminal
|
||||
if (getpid() == tcgetpgrp(STDIN_FILENO))
|
||||
{
|
||||
tcsetattr(STDIN_FILENO, TCSANOW, &terminal_mode_on_startup);
|
||||
}
|
||||
}
|
||||
|
||||
void reader_exit(int do_exit, int forced)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user