LoginSignup
1
1

More than 5 years have passed since last update.

ฅ(・ω・ฅ)/{ cygwin 環境に zsh を入れて, 端末起動時に cowsay する }

Posted at

:musical_score: 概要

cygwin 環境に zsh を入れて, 端末起動時に cowsay します

:raised_hand: 前提

  • apt-cyg をインストール済み

インストール

$ apt-cyg install zsh
$ which zsh
/usr/bin/zsh
$ zsh --version
zsh 5.0.6 (x86_64-unknown-cygwin)

:door: Zshをログインシェルにする

/etc/passwd を編集

  • before
XXXXXXX/your_user:/bin/bash
  • after
XXXXXXX/your_user:/usr/bin/zsh

Terminal を起動

  • メニューが表示されます

zsh1.png

  • 対話に返答して任意の設定を行います

  • 起動しました

zsh2.png

複数の端末を起動し、履歴を共有します

~/.zshrc の設定

# メモリ 履歴件数
HISTSIZE=100000

# 履歴ファイルパス
HISTFILE=$HOME/.zsh-history
# ファイル 履歴件数
SAVEHIST=100000

# 全履歴の表示
function history-all { history -E 1 }
# 履歴の共有
setopt share_history

:cow: 端末起動時に cowsay を呼び出します

~/.zshrc の末尾に追記

cowsay "Hello!"

出力例

1 回目

cowsay1.png

2 回目

cowsay2.png

3 回目

cowsay3.png

:books: 外部資料

1
1
3

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