From f3b623a7c57742d3db9ab5490e36957c6f2d63f3 Mon Sep 17 00:00:00 2001 From: Nick Chambers Date: Mon, 24 Oct 2022 19:40:32 -0500 Subject: [PATCH] Make the iTerm2 module useful --- dotlib/darwin/iterm2.sh | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/dotlib/darwin/iterm2.sh b/dotlib/darwin/iterm2.sh index 2f6de0b..dc5573a 100644 --- a/dotlib/darwin/iterm2.sh +++ b/dotlib/darwin/iterm2.sh @@ -1,25 +1,3 @@ -# Based on the iTerm2 Bash integration script - -if [[ $OSTYPE != darwin* ]]; then - return 0 -fi - -iterm2_write() { - local cmd=$1 fmt=$2 - shift 2 - printf "\033]1337;%s=$fmt\007" "$cmd" "$@" +refresh() { + printf "\x1B[H\x1B[2J\x1B[3J" } - -iterm2_write_state() { - iterm2_write RemoteHost %s@%s "$USER" "$iterm2_hostname" - iterm2_write CurrentDir %s "$PWD" -} - -iterm2_prompt_command() { - iterm2_write_state -} - -ITERM_SHELL_INTEGRATION_INSTALLED=Yes -ITERM_PREV_PS1=$PS1 -iterm2_hostname=${HOSTNAME-"$(hostname -f 2>/dev/null)"} -PROMPT_COMMAND+=(iterm2_prompt_command)