Skip to content

How does Chezmoi pick a shell for its cd command? #3088

Answered by twpayne
J-Kappes asked this question in Q&A
Discussion options

You must be logged in to vote

See https://github.com/twpayne/chezmoi/blob/master/pkg/shell/shell_posix.go#L14.

chezmoi checks the following in order, using the first value that it finds:

  1. The $SHELL environment variable.
  2. The getpwnam_r library call.
  3. The output of getent passwd $USER.
  4. The user's entry in /etc/passwd.
  5. The default shell for the OS.

Are you sure you changed your shell with chsh?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@J-Kappes
Comment options

@twpayne
Comment options

Answer selected by J-Kappes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants