diff options
| -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 \$ ' |
