when trying to spawn a VM for testing through nixos-shell, I encountered errors when invoking command through ssh host COMMAND. This always showed the message resize: can't open terminal /dev/tty before the command output (which still ran successfully itself).
This is caused by an entry in /etc/profile, configured in share/modules/nixos-shell-config.nix, which calls resize indiscriminately. This PR adds a condition to the resize invocation to only call in TTYs.
To quote the commit message:
Resize is only called if stdout is opened. This is checked through the test command. As it is not a shell builtin in all POSIX shells (although it is it is in bash), it is called from the coreutils packages using its full path. (The alternative of adding coreutils to the globally installed system packages might break setups.)
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).
Dear Mic92 (and other maintainers?),
when trying to spawn a VM for testing through nixos-shell, I encountered errors when invoking command through
ssh host COMMAND
. This always showed the messageresize: can't open terminal /dev/tty
before the command output (which still ran successfully itself).This is caused by an entry in
/etc/profile
, configured inshare/modules/nixos-shell-config.nix
, which callsresize
indiscriminately. This PR adds a condition to theresize
invocation to only call in TTYs.To quote the commit message: