8
7

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でtypoしたときのメッセージを可愛くする

Last updated at Posted at 2016-02-16
$ sl
zsh: command not found: sl

カワイクナイ(´・ω・`)

zshではコマンドが無い場合command_not_found_handlerでフック出来るっぽいので、~/.zshrcに下記を追加。

.zshrc
function command_not_found_handler() {
  echo "(」・ω・)」うー!(/・ω・)/にゃー!→「$1」";
}
$ sl
(」・ω・)」うー!(/・ω・)/にゃー!→「sl」

カワイイ(๑˃̵ᴗ˂̵)و

ちなみにbashではcommand_not_found_handleでフックする。rいらない。

.bashrc
function command_not_found_handle() {
  echo "(」・ω・)」うー!(/・ω・)/にゃー!→「$1」";
}

参考

http://cpplover.blogspot.jp/2015/05/blog-post_28.html
http://pgmot.hatenablog.com/entry/2015/06/01/125049

8
7
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
8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?