0
1

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 1 year has passed since last update.

zshのスタートアップファイルについて

Posted at

ユーザーズガイドの2章に記載されています。
A User's Guide to the Z-Shell

2.1でシェルのタイプとしてインタラクティブシェルとログインシェルの説明があります。「インタラクティブ」とは、プロンプトでコマンドを入力して各コマンドが実行されるのを待つケースです。「非インタラクティブ」とはファイルからコマンドを読んで実行するようなケースです。ログインシェルは、最初にコンピュータにログインするときのシェルのことです。などなど…。
2.1 Types of shell

2.2にすべてのスタートアップファイルについて説明があります。
2.2 All the startup files

/etc/zshenv
どのzshでも常に(always)実行される
~/.zshenv
どのzshでもたいてい(usually)実行される
/etc/zprofile
ログインシェルで実行される
~/.zprofile
ログインシェルで実行される
/etc/zshrc
インタラクティブシェルで実行される
~/.zshrc
インタラクティブシェルで実行される
/etc/zlogin
ログインシェルで実行される
~/.zlogin
ログインシェルで実行される
  • ホームディレクトリのスタートアップファイルは、$ZDOTDIRで設定されるディレクトリにあるスタートアップファイルが優先されます。
  • zprofileとzloginはどちらもログインシェルで実行されますが、実行される順序が違います。zprofileはzshrcが実行される前に、zloginはzshrcが実行された後に実行されます。

他にもNO_RCSの説明やzlogoutの説明があります。
とりあえずzprofileとzshrcに記載すれば問題なさそうですね。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?