fish shell - Showing the current command in the window title of screen

孤街浪徒 提交于 2019-12-04 09:40:46

For fish version 2.1.0 you only have to edit ~/.config/fish/functions/fish_title.fish

function fish_title
    hostname
end

For version 1.23.1 this doesn't seem to work. If the directories do not exist, first create them:

mkdir -p ~/.config/fish/functions/

I think you're looking for fish_title. See documentation here.

You could do something like this:

function fish_title
    echo $_ ' '
    pwd
end
funcsave fish_title

(Note you just run this at a prompt - don't put it in a config file).

Thanks for your answers. Finally, this made it work!

.screenrc

shelltitle "$ |fish"
shell /usr/local/bin/fish

.config/fish/config.fish

function fish_prompt
    echo -ne '\033k'
    echo -ne $argv
    echo -ne '\033\\'
    echo -ne '$ '
end
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!