2

I'm using ruby version manager rvm which requires its commands to be run in a login shell.

gnome-terminal provides an option for commands to run as a login shell as described here.

however, there's not any similar option in patheon-terminal. is there a work around for this issue?

1
  • for now I have to run bash --login everytime I open a terminal, which is inconvenient imo. Dec 28, 2016 at 13:27

3 Answers 3

6

Setting the shell key to bash --login doesn't work, however I managed to fix that with the following workaround:

create a file named bashlogin in /bin directory with the following content

#!/bin/sh
exec bash --login

mark it as executable

sudo chmod +x /bin/bashlogin

and finally set the terminal shell key

gsettings set io.elementary.terminal.settings shell 'bashlogin'

3
  • FYI, the setting location has changed in ElementaryOS 5.0 Juno. It's now located in gsettings set io.elementary.terminal.settings shell 'bashlogin' Jan 17, 2019 at 10:22
  • the answer is updated now Jan 20, 2019 at 15:20
  • It worked for me on elementary OS 5.1.7 Hera May 17, 2021 at 22:32
2

You can set the key shell under org.pantheon.terminal.settings in dconf-editor or via the command line:

gsettings set org.pantheon.terminal.settings shell 'bash --login'
3
  • It doesn't work, terminal now hangs and shows no shell prompt. Dec 31, 2016 at 9:46
  • 2
    it seems that the shell key doesn't accept commands with arguments. Dec 31, 2016 at 9:57
  • @AboudZakaria My terminal hangs, too. How can I recover it? Aug 15, 2019 at 1:41
0

If like me you use zsh :

change

#!/bin/sh
exec bash --login

by :

#!/bin/zsh
exec zsh --login

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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