diff --git a/fish/files/config.fish b/fish/files/config.fish index 42f1dea..21d47d5 100644 --- a/fish/files/config.fish +++ b/fish/files/config.fish @@ -27,6 +27,14 @@ end status is-interactive; and begin + # On macOS SSH sessions, normalize TERM if remote terminfo is missing + # (eg. TERM=alacritty from Linux host), otherwise tools like jj/less warn + if test (uname) = Darwin; and set -q SSH_TTY + if not infocmp "$TERM" >/dev/null 2>&1 + set -gx TERM xterm-256color + end + end + # Abbreviations abbr -a tx 'tmux' abbr -a txa 'tmux attach' diff --git a/matugen/files/scripts/sync-mac.sh b/matugen/files/scripts/sync-mac.sh index d0f706b..9b2bed5 100755 --- a/matugen/files/scripts/sync-mac.sh +++ b/matugen/files/scripts/sync-mac.sh @@ -18,6 +18,16 @@ sync_file() { remote_path="$2" remote_cmd="${3-}" + # If caller passes a local absolute path, mirror it under remote $HOME. + case "$remote_path" in + "$HOME") + remote_path="~" + ;; + "$HOME"/*) + remote_path="~/${remote_path#"$HOME"/}" + ;; + esac + remote_dir="$(dirname "$remote_path")" remote_tmp="${remote_path}.tmp"