mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
Shell: Properly set and restore termios settings.
Previously, we did not properly restore termios settings after running built-in commands. This has been fixed by ensuring that we only change the termios settings when we are forking a child process.
This commit is contained in:
parent
378480e8e4
commit
058c8337df
Notes:
sideshowbarker
2024-07-19 11:30:02 +09:00
Author: https://github.com/DrewStratford Commit: https://github.com/SerenityOS/serenity/commit/058c8337df9 Pull-request: https://github.com/SerenityOS/serenity/pull/699
1 changed files with 1 additions and 1 deletions
|
@ -634,7 +634,6 @@ static int run_command(const String& cmd)
|
|||
|
||||
struct termios trm;
|
||||
tcgetattr(0, &trm);
|
||||
tcsetattr(0, TCSANOW, &g.default_termios);
|
||||
|
||||
struct SpawnedProcess {
|
||||
String name;
|
||||
|
@ -730,6 +729,7 @@ static int run_command(const String& cmd)
|
|||
if (!child) {
|
||||
setpgid(0, 0);
|
||||
tcsetpgrp(0, getpid());
|
||||
tcsetattr(0, TCSANOW, &g.default_termios);
|
||||
for (auto& rewiring : subcommand.rewirings) {
|
||||
#ifdef SH_DEBUG
|
||||
dbgprintf("in %s<%d>, dup2(%d, %d)\n", argv[0], getpid(), rewiring.rewire_fd, rewiring.fd);
|
||||
|
|
Loading…
Add table
Reference in a new issue