t*****t 发帖数: 72 | 1 【 以下文字转载自 Linux 讨论区 】
【 原文由 tecplot 所发表 】
我设置了一个别名:
alias cd 'cd \!* && set prompt="%{\e]2\;%t - [%c]^g\e]1\;%c^g\r%}
$HOSTNAME.%c> "&& echo $cwd'
这样我每次在xterm里面按“cd”,xtrem窗口的caption上就会自动显示当前目录
的名称。现在我希望每执行一个程序,例如在xterm里面打开gdb,对应的该xterm
的顶部的Captions就自动改成[gdb].请教如何设置。就是如何捕获当前xterm正在
运行程序的名称?多谢。。。 |
c*r 发帖数: 278 | 2 for tcsh, you can alias "postcmd".
【在 t*****t 的大作中提到】 : 【 以下文字转载自 Linux 讨论区 】 : 【 原文由 tecplot 所发表 】 : 我设置了一个别名: : alias cd 'cd \!* && set prompt="%{\e]2\;%t - [%c]^g\e]1\;%c^g\r%} : $HOSTNAME.%c> "&& echo $cwd' : 这样我每次在xterm里面按“cd”,xtrem窗口的caption上就会自动显示当前目录 : 的名称。现在我希望每执行一个程序,例如在xterm里面打开gdb,对应的该xterm : 的顶部的Captions就自动改成[gdb].请教如何设置。就是如何捕获当前xterm正在 : 运行程序的名称?多谢。。。
|
t*****t 发帖数: 72 | 3 what's that? I type postcmd in unix, it returns:
Command not found.
【在 c*r 的大作中提到】 : for tcsh, you can alias "postcmd".
|
c*r 发帖数: 278 | 4 man tcsh:
postcmd Runs before each command gets executed.
> alias postcmd 'echo -n "^[]2\;\!#^G"'
then executing vi foo.c will put the command string
in the xterm title bar.
'^[' and '^G' are from ctrl-v + ESC and ctrl-v +ctrl-g
【在 t*****t 的大作中提到】 : what's that? I type postcmd in unix, it returns: : Command not found.
|