boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - [转载] 如何返回当前窗口正在运行的程序名称
相关主题
How to set the titile of the terminal?
我的alia放在script里为什么不工作?
够执着的 --- Re: 我的alia放在script里为什么不工作?
tc shell script??
.cshrc?.login?.profile?
[转载] 请教高手
请教CRON DEAMON
请教个scripts的问题
输入xterm总提示display错误
xterm Xt error: Can't open display::0
相关话题的讨论汇总
话题: xterm话题: postcmd话题: alias话题: command话题: ctrl
进入Unix版参与讨论
1 (共1页)
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.

1 (共1页)
进入Unix版参与讨论
相关主题
xterm Xt error: Can't open display::0
Enviroment Config Help
hotkey in unix
about autocompletion
Re: How to setup the arrowkey(for history command) and table-complete
AIX shell configuration
Command history
Re: 怎么在bash script里面改变xterm窗口的标题?
bash prompt 一问
bash 彩色 shell prompt
相关话题的讨论汇总
话题: xterm话题: postcmd话题: alias话题: command话题: ctrl