diff --git a/README.md b/README.md index 1dec243..ddd38c7 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,9 @@ $ omf u nelsonjchen * re5et: 24 hour clock * MM DD YY date format * re5et: YY MM DD date format - +* Title Setting to the `prompt_pwd` function in fish for screen, tmux, and non-terminal multiplexer. + * This is derived from [@chgu82837's theme](https://github.com/chgu82837/theme-PastFish/blob/39af8e2885e308501bb0afa9dedab193a8722cfe/fish_prompt.fish#L82-L90) + ## Omissions from the re5et version * Trimming down the working directory display only works on `~`. The original re5et prompt would also trim based on the current environment variables set. For example, if you had the environment variable `FOO` set to `/usr/local` and you did `cd /usr/local`, you would see `$FOO/` in the prompt as the current working directory. I'm not sure how I would get this working. `fish` does appear to have a condensation function but it goes beyond simple environment variable replacement and I can't figure out how to turn it off. diff --git a/fish_right_prompt.fish b/fish_right_prompt.fish index b41482b..2ce079e 100644 --- a/fish_right_prompt.fish +++ b/fish_right_prompt.fish @@ -7,5 +7,13 @@ function fish_right_prompt -d "Write out the right prompt" set_color normal end + # tmux, screen title + switch $TERM; + case xterm'*' vte'*'; + printf '\033]0;['(prompt_pwd)']\007'; + case screen'*'; + printf '\033k['(prompt_pwd)']\033\\'; + end + echo -ns (date "+%D")" - "(date "+%l:%M %p") end diff --git a/fish_title.fish b/fish_title.fish index a267373..e23b92c 100644 --- a/fish_title.fish +++ b/fish_title.fish @@ -1,3 +1,6 @@ function fish_title -# Customize the title bar of the terminal window. + # Customize the title bar of the terminal window. + # This does not affect tmux. Look at fish_right_prompt for what actually + # affects it. + echo '['(prompt_pwd)']' end