summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2022-10-26 14:53:51 +0200
committerAlan Pearce2022-10-26 14:53:51 +0200
commit723c2134d51d9a07cc9fd5eb69d49b4b09412d65 (patch)
treec9e0ffe19ce2d2b63db6e70b336331e71dff4f17
parent954178d627dadc8c106416f5ccbad49061e699a8 (diff)
downloadnixfiles-723c2134d51d9a07cc9fd5eb69d49b4b09412d65.tar.lz
nixfiles-723c2134d51d9a07cc9fd5eb69d49b4b09412d65.tar.zst
nixfiles-723c2134d51d9a07cc9fd5eb69d49b4b09412d65.zip
zsh/darwin: don't print escape codes when piping from SSH
-rw-r--r--user/zsh/zshrc.darwin15
1 files changed, 10 insertions, 5 deletions
diff --git a/user/zsh/zshrc.darwin b/user/zsh/zshrc.darwin
index 1b4ecc9b..c8f17a43 100644
--- a/user/zsh/zshrc.darwin
+++ b/user/zsh/zshrc.darwin
@@ -10,11 +10,16 @@ ssh() {
 			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 "$@"