From 956be337283ad9e4810e7c11c0a5aa310950f0db Mon Sep 17 00:00:00 2001 From: Earnestly Date: Fri, 14 Dec 2018 14:47:57 +0000 Subject: [PATCH] sx: remove case check on tty Substring removal using the '#' form will already try to match from the beginning of the string. If the output from ps does not start with "tty" then nothing will be removed. --- sx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sx b/sx index 8893859..21a675f 100755 --- a/sx +++ b/sx @@ -20,10 +20,7 @@ cleanup() { stty=$(stty -g) tty=$(ps -o tty= $$) - -case $tty in - tty*) tty=${tty#tty} -esac +tty=${tty#tty} cfgdir=${XDG_CONFIG_HOME:-$HOME/.config}/sx datadir=${XDG_DATA_HOME:-$HOME/.local/share}/sx