I have the following line:
echo -ne "\033]开发者_如何学Python0;blah\007"
that correctly sets the term name to blah
. But if I place that line within a function, as in:
setTermName()
{
echo -ne "\033]0;blah\007"
}
it doesn't work anymore. I guess escape sequences are not treated correctly within the function. So my question could be reformulated as: How do you use escape sequences within a function?
I only want to be able to do setTermName foo
from command line.
You invoke that echo command from interactive ksh also? Are you sure it understands -ne
? It's not standard. Maybe use printf
.
And you can try to use alias
instead.
UPD: I've checked with AIX ksh, the following function worked:
set_tn()
{
printf "\033]0;$1\007"
}
精彩评论