そうです、 ~/.oh-my-zsh が原因です。~/.oh-my-zsh/lib/termsupport.zsh に入ります
#Appears at the beginning of (and during) of command execution
function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
local LINE="${2:gs/$/\\$}"
LINE="${LINE:gs/%/%%}"
title "$CMD" "%100>...>$LINE%<<"
}
コマンドの後に続くものを含むコマンド全体にタイトルを設定しようとしていることがわかります。sudo などのプレフィックスを削除し、$ や % などの文字をエスケープします。しかし、何らかの理由で、cat を実行すると改行が挿入されます。簡単な修正のために、次のようにタイトルを $CMD に設定するだけで、oh-my-zsh を少し手こずっています。
#Appears at the beginning of (and during) of command execution
function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
## Removing command argument parsing because of cat bug
#local LINE="${2:gs/$/\\$}"
#LINE="${LINE:gs/%/%%}"
#title "$CMD" "%100>...>$LINE%<<"
title "$CMD"
}
oh-my-zsh の github にあるこのファイルの最近の履歴をさかのぼりましたが、このバグはしばらくの間存在していたようです。「正しい」答えは、おそらく $LINE の周りにネストされた展開を行い、空白と改行を削除し、oh-my-zsh にプル リクエストを行うことです。しかし、私の zsh foo はこれにはまだ弱すぎます。