6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

zshのプロンプト表示を定期更新

Last updated at Posted at 2013-01-20

プロンプト左側の表示を0〜9までカウントアップさせる例
任意のコマンドを実行できるため、天気や時計、脈拍数なんかを表示させたら面白いかもしれない。

.zshrc
setopt PROMPT_SUBST
COUNT=0
PS1='$COUNT $ '
# Handler for ALRM signal
TRAPALRM () { 
  if [ $COUNT -lt 10 ]; then
    COUNT=`expr $COUNT + 1`
  fi              
  zle reset-prompt # update PS1
}                 
TMOUT=1 # interval secound
6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?