all repos — nixfiles @ 723c2134d51d9a07cc9fd5eb69d49b4b09412d65

System and user configuration, managed by nix and home-manager

zsh/darwin: don't print escape codes when piping from SSH
Alan Pearce alan@alanpearce.eu
Wed, 26 Oct 2022 14:53:51 +0200
commit

723c2134d51d9a07cc9fd5eb69d49b4b09412d65

parent

954178d627dadc8c106416f5ccbad49061e699a8

1 files changed, 10 insertions(+), 5 deletions(-)

jump to
M user/zsh/zshrc.darwinuser/zsh/zshrc.darwin
@@ -10,11 +10,16 @@ server=$arg 			break
 		fi
 	done
-	set_title "file://${server}/"
-	command ssh "$@"
-	retval=$?
-	set_title
-	return $retval
+	if [[ ! -p /dev/fd/1 ]]; then
+		set_title "file://${server}/"
+		command ssh "$@"
+		retval=$?
+		set_title
+		return $retval
+	else
+		command ssh "$@"
+		return $retval
+	fi
 }
 mosh() {
 	command mosh "$@"