diff options
| author | Zach DeCook <zachdecook@librem.one> | 2026-07-03 13:27:06 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2026-07-03 13:27:06 -0400 |
| commit | f919c973440869c727b64869078712bf2eb1ae5d (patch) | |
| tree | e2a55363fbcc02339bbc5b71727cfd752b3d0534 | |
| parent | e8dab7e7b7de59d54ebd43ab22a3c561830f3921 (diff) | |
| download | dotfiles-f919c973440869c727b64869078712bf2eb1ae5d.tar.gz | |
use osc7 to indicate cwd mac-aarch64
| -rwxr-xr-x | .local/bin/osc7 | 14 | ||||
| -rw-r--r-- | .profile | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/.local/bin/osc7 b/.local/bin/osc7 new file mode 100755 index 0000000..bdd034a --- /dev/null +++ b/.local/bin/osc7 @@ -0,0 +1,14 @@ +#!/bin/sh + tmp="$PWD" + enc="" + while [ -n "$tmp" ]; do + cut="${tmp#?}" + c="${tmp%"$cut"}" + case "$c" in + [-/:_.!\'\(\)~[:alnum:]] ) enc="$enc$c" ;; + * ) enc="$enc$(printf '%%%02X' """\"$c")" ;; + esac + tmp="$cut" + done + + printf "\033]7;file://%s%s\007" "$(hostname)" "$enc" diff --git a/.profile b/.profile index bab387d..f6bb35a 100644 --- a/.profile +++ b/.profile @@ -8,4 +8,4 @@ if [ "$(tty)" = /dev/tty6 ]; then fi # Set the window title to the path -export PS1='`echo -ne "\033]0;${PWD}\007" 1>&2`\w \$ ' +export PS1='$(osc7)`echo -ne "\033]0;${PWD}\007" 1>&2`\w \$ ' |
