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?

  • for now I have to run bash --login everytime I open a terminal, which is inconvenient imo. – Aboud Zakaria Dec 28 '16 at 13:27
4

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'

  • FYI, the setting location has changed in ElementaryOS 5.0 Juno. It's now located in gsettings set io.elementary.terminal.settings shell 'bashlogin' – Evan Plaice Jan 17 at 10:22
  • the answer is updated now – Aboud Zakaria Jan 20 at 15:20
1

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'
  • It doesn't work, terminal now hangs and shows no shell prompt. – Aboud Zakaria Dec 31 '16 at 9:46
  • 2
    it seems that the shell key doesn't accept commands with arguments. – Aboud Zakaria Dec 31 '16 at 9:57
  • @AboudZakaria My terminal hangs, too. How can I recover it? – Aetherus Zhou Aug 15 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, privacy policy and cookie policy

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