diff --git a/sx b/sx index e2ac46d..528750b 100755 --- a/sx +++ b/sx @@ -19,8 +19,8 @@ cleanup() { } stty=$(stty -g) -tty=$(ps -o tty= -p $$) -tty=${tty#tty} +tty=$(tty) +tty=${tty#/dev/tty} cfgdir=${XDG_CONFIG_HOME:-$HOME/.config}/sx datadir=${XDG_DATA_HOME:-$HOME/.local/share}/sx