mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 01:11:15 -03:00
Don't print a warning about tcgetattr if stdin is not a tty
I don't know why this doesn't happen more often, but if stdin is not a tty not being able to get terminal attributes from it is *expected*?
This commit is contained in:
@@ -868,6 +868,8 @@ static bool terminal_return_from_job(job_t *j, int restore_attrs) {
|
||||
|
||||
// Save jobs terminal modes.
|
||||
if (tcgetattr(STDIN_FILENO, &j->tmodes)) {
|
||||
// If it's not a tty, it's not a tty, and there are no attributes to save (or restore)
|
||||
if (errno == ENOTTY) return false;
|
||||
if (errno == EIO) redirect_tty_output();
|
||||
FLOGF(warning, _(L"Could not return shell to foreground"));
|
||||
wperror(L"tcgetattr");
|
||||
|
||||
Reference in New Issue
Block a user