The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

What shell does ‘exec’ actually use and how can I change it?

asked 2015-08-08 19:51:31 +0000

k.stm gravatar image

updated 2015-08-08 20:00:45 +0000

This might be a non-i3-question after all.

In the i3 docs, it says that

“What good is a window manager if you can’t actually start any applications? The exec command starts an application by passing the command you specify to a shell,”

but what shell are the commands actually passed to? My user’s shell is set to /bin/zsh, but apparently exec invokes command via /bin/sh. How can I change that?

I use debian testing/unstable, should that matter.

Background: I use an i3 key binding to invoke urxvtcd -e emacs -nw, but evaluating (getenv "PATH") from within emacs gives me then the wrong environment (whereas (getenv "SHELL") gives me /bin/zsh).

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2015-08-08 23:20:10 +0000

Airblader gravatar image

i3 uses /bin/sh because this is available everywhere. You cannot modify this. Leaving aside the question of why your /bin/sh doesn't just point to zsh, you can do this:

exec /bin/zsh
edit flag offensive delete link more


Or `exec zsh -c whatever`. Ok.

k.stm gravatar imagek.stm ( 2015-08-09 15:23:30 +0000 )edit

Question Tools

1 follower


Asked: 2015-08-08 19:51:31 +0000

Seen: 283 times

Last updated: Aug 08