Skip to content

Commit 6543d38

Browse files
committed
shell config: only resize if on tty
Resize is only called if stdout is opened. If it is not opened, there is no TTY to be resized. The previous configuration calls resize on any login shell through /etc/profile, which outputs an error messages on shells not on a tty. (That can occur when using ssh to call a command directly, i.e. `ssh host echo foo`).
1 parent 93e314c commit 6543d38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

share/modules/nixos-shell-config.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ in {
112112
path = builtins.getEnv "PATH";
113113
in
114114
''
115-
# fix terminal size
116-
eval "$(resize)"
115+
# if terminal with stdout, fix terminal size
116+
if [ -t 1 ]; then eval "$(resize)"; fi
117117
118118
${lib.optionalString (pwd != "") "cd '${pwd}' 2>/dev/null"}
119119
${lib.optionalString (term != "") "export TERM='${term}'"}

0 commit comments

Comments
 (0)