I use one of the many solutions to set the terminal title:
Function in .bashrc
:
function set-title() {
if [[ -z "$ORIG" ]]; then
ORIG=$PS1
fi
TITLE="\[\e]2;$*\a\]"
PS1=${ORIG}${TITLE}
}
And it works perfectly! But when I ssh to a remote host, the title is changed to ubuntu@remote.host.name
.
Is there any solution to prevent title changing after ssh?
.bashrc
. Some of them in production environment so any modification on them is restricted. Others are test servers and their uptime very short so I need to modify.bashrc
many times per day. But anyway thank you for the suggestion @Pie. – i.bondarenko Oct 01 '19 at 04:34alias myssh="ssh servername;set_title"
– waltinator Dec 04 '19 at 18:16alias myssh="ssh ubuntu@host;set-title my_title1"
but without success. – i.bondarenko Dec 05 '19 at 06:54set-title
will only be invoked afterssh
ends, i.e., when you disconnect from the remote. – MestreLion Nov 26 '21 at 16:17