foxshell/fn/-z4h-tmux-bypass
2025-07-04 11:48:40 -05:00

12 lines
243 B
Bash

#!/usr/bin/env zsh
local x
builtin printf -v x "$@"
(( _z4h_can_save_restore_screen )) && x+=$'\ePtmux;'${x//$'\e'/$'\e\e'}$'\e\\'
if [[ -t 1 ]]; then
print -rn -- "$x"
elif [[ -v _z4h_tty_fd ]]; then
print -rnu $_z4h_tty_fd -- "$x"
fi