diff options
author | Kurtis Rader <krader@skepticism.us> | 2015-12-25 14:47:30 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-12-27 12:28:19 -0800 |
commit | 979b94e274e10fe3c82c5b8a8c8f373d82489800 (patch) | |
tree | 552d4cf6ffd84e0d457b49b712300fc1723ffa81 /src/reader.cpp | |
parent | 076ebf8ceed4519e39297c53ae56d12e813ac330 (diff) |
only swith to shell tty mode if interactive
My PR #2578 had the unexpected side-effect of altering the tty modes of
commands run via "fish -c command" or "fish scriptname". This change fixes
that; albeit incompletely. The correct solution is to unconditionally set
shell tty modes if stdin is attached to a tty and restore the appropriate
modes whenever an external command is run -- regardless of the path used to
run the external command. The proper fix should be done as part of addressing
issues #2315 and #1041.
Resolves issue #2619
Diffstat (limited to 'src/reader.cpp')
-rw-r--r-- | src/reader.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/reader.cpp b/src/reader.cpp index fa3d887d..d67bc885 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1053,7 +1053,12 @@ void reader_init() // earliest possible moment. Doing it here means it will be done within // approximately 1 ms of the start of the shell rather than 250 ms (or // more) when reader_interactive_init is eventually called. - tcsetattr(STDIN_FILENO, TCSANOW,&shell_modes); + // + // TODO: Remove this condition when issue #2315 and #1041 are addressed. + if (is_interactive_session) + { + tcsetattr(STDIN_FILENO, TCSANOW,&shell_modes); + } } |