diff options
author | tdro <tdro@users.noreply.github.com> | 2024-02-26 20:45:07 -0500 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2024-02-26 20:45:07 -0500 |
commit | b40c0f34c3d7cc043e2a714195b5b9643e4cce2c (patch) | |
tree | eced6c49a00e95b3dc901960233870cedf667f01 | |
parent | 6b75c4809a1a55894cc49a74a337aefe90b348cc (diff) | |
download | dotfiles-b40c0f34c3d7cc043e2a714195b5b9643e4cce2c.tar.gz dotfiles-b40c0f34c3d7cc043e2a714195b5b9643e4cce2c.tar.bz2 dotfiles-b40c0f34c3d7cc043e2a714195b5b9643e4cce2c.zip |
.bashrc: Improve window titles
-rw-r--r-- | .bashrc | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -124,10 +124,11 @@ docker-rootfs() { id=$(docker run --detach "$1" /bin/true) \ && docker container rm "$id" \ && ls -l rootfs.tar; } -# https://til.simonwillison.net/bash/escaping-a-string -# press ctrl+d after writing string to standard input +# press ctrl+d after writing string to standard input (https://til.simonwillison.net/bash/escaping-a-string) shellquote() { printf '%q\n' "$(cat)"; } -trap 'echo -ne "\033]2;command: $(history 1 | shellquote)\007"' DEBUG + +# show window title of last command (https://stackoverflow.com/a/5080670) +trap 'echo -ne "\033]2;command: $PWD $(history 1 | sed "s/^[ ]*[0-9]*[ ]*//g")\007"' DEBUG # swallow swallow() { "$@" & disown; exit; } |