FAQ から抜粋。 > 3.6: How do I automatically display the directory in my xterm title bar? > > You should use the special function `chpwd', which is called when > the directory changes. The following checks that standard output is > a terminal, then puts the directory in the title bar if the terminal > is an xterm or some close relative, or a sun-cmd. > > chpwd() { > [[ -t 1 ]] || return > case $TERM in > sun-cmd) print -Pn "\e]l%~\e\\" > ;; > *xterm*|rxvt|(dt|k|E)term) print -Pn "\e]2;%~\a" > ;; > esac > } > > Change `%~' if you want the message to be different. (The `-P' > option interprets such sequences just like in prompts, in this case > producing the current directory; you can of course use `$PWD' here, > but that won't use the `~' notation which I find clearer.) Note that > when the xterm starts up you will probably want to call chpwd > directly: just put `chpwd' in .zshrc after it is defined or autoloaded.
function precmd { local exit=$? if [ $exit = 0 ]; then echo "\033]2;(゚д゚)ウマー\007\c" elif [ $exit = 255 ]; then echo "\033]2;( ゚д゚)ポカーン\007\c" else echo "\033]2;(゚Д゚)マズー\007\c" fi }
_normal:26: bad math expression: operator expected at `0'
と言われてしまいますが、同じような症状の方、います?
313 :名無しさん@お腹いっぱい。 :02/02/12 08:50
.zshrc: [[ -r $SSH_AUTH_SOCK ]] || unset SSH_AUTH_SOCK SSH_AGENT_PID if [[ -z $SSH_AUTH_SOCK ]]; then set -A a /tmp/ssh-*/*(UN=) [[ -n $a ]] && export SSH_AUTH_SOCK=${a[-1]} unset a fi
.zshrcのサンプルに alias mv='nocorrect mv' # no spelling correction on mv alias cp='nocorrect cp' # no spelling correction on cp alias mkdir='nocorrect mkdir' # no spelling correction on mkdir
EXTENDED_HISTORY <C> Save each command's beginning timestamp (in seconds since the epoch) and the duration (in seconds) to the history file. The format of this prefixed data is:
freebsd4.5Rを使っています お聴きしたいのですが.cshrcはなにもいじってない状態で rootになった時に ls -l ls -F ls -a と上から順にうってlsだけ入力した状態で 矢印keyの上を押すとls -aもう一度押すとls -Fのように ls以降の文字列だけを検索?のようにできるようなのですが zshではhistoryの下から順にしか表示されないのですが 上のような感じの機能あると便利なのですがzshでも可能でしょうか?
alias [ {+|-}gmrL ] [ name[=value] ... ] For each name with a corresponding value, define an alias with that value. A trailing space in value causes the next word to be checked for alias expansion. If the -g flag is present, define a global alias; global aliases are expanded even if they do not occur in command position.
最後の文に関しては、例えば、dump-1 dump-2 .. dump-22 というファイルが あってほしいときに抜けがあった場合、 ls dump-<1-22> としても別段文句を言われませんが、 ls dump-{1..22} とすると ls にそんなファイルはないと文句を言われるので、抜けに気付くという ことです。
memberというファイルにuserIDが書いてあります。 for i in `cat member` echo ~$i とやるともしmember存在しないID(hoge)があると、 zsh: no such user or named directory: hoge となって途中で止まります。 エラーが出ても良いので止まるのだけはなんとかしたいのですが。アドバイスお願いします。