I am using terminator with zsh as my shell:

terminator --command="/bin/zsh"

Additionally, I need another way to start terminator with zsh and make sure that the window does not close on ctrl+d.

I know that I can use set -o ignoreeof inside .zshrc to prevent ctrl+d exiting the terminal. But that will affect all zsh shells.

I don't want to change this globally. One way that I think would be possible, is to have two separate configuration files. But than I would have to maintain two files instead of one. Is there a simpler way to start zsh with set -o ignoreeof enabled? perhaps specifying this as an option on the commandline?


You virtually answered your own question. Just run:

terminator --command='/bin/zsh -o ignoreeof'


info zsh Invocation

for details on how to invoke zsh.


One way to do this is to have terminator set some environment variable (if it does not already)

env HI_IMA_TERMINATOR=1 terminator --command="/bin/zsh"

and then detect that in the ZSH configuration file:

if [[ -n $HI_IMA_TERMINATOR ]]; then
    set -o ignoreeof

(The above method will not fly if terminator cleans out the env for security or other reasons.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.