1

I want to make fish the default Interactive shell, but do not want to set it as the login shell as stated in the Arch Wiki and Gentoo Wiki. I have followed the instructions mentioned there, however I am facing a problem - At the login, I give the credentials to the user, it logs in, but after reading the .bashrc it logout quickly and I am back at the login screen.

My .bashrc:

if [[ $- != *i* ]] ; then
    # Shell is non-interactive.  Be done now!
    return
fi

exec /usr/bin/fish

When I login with another user on the system I find that $- = himGHs

PS:

  • There are no dm installed, thus login screen is the default text interface in the console.
  • Debian 10 x64 bit
  • Default shell is bash
  • \usr\bin\fish exists
Community
  • 1
  • 1
Arjob Mukherjee
  • 387
  • 1
  • 10
  • Does `/usr/bin/fish` exist? Remove the `exec` keyword so you can see the error message once you return to the `bash` shell, rather than exiting and ending your login session. – chepner May 12 '20 at 13:43
  • yes it exists.. – Arjob Mukherjee May 12 '20 at 13:47
  • @chepner I did, but no error. – Arjob Mukherjee May 12 '20 at 13:52
  • 1
    That's strange. What happens when you type `exec /usr/bin/fish` manually after you logged in? PS: You might get more help on https://unix.stackexchange.com/. – Socowi May 12 '20 at 14:18
  • I'm voting to close this question as it was ["moved" to Unix SE](https://unix.stackexchange.com/questions/586164/cannot-set-fish-as-the-interactive-shell). – Socowi May 12 '20 at 15:10
  • Hmm, I just voted to close the Unix&Linux question as a duplicate before I saw these comments. I think fish questions will get more visibility here. – glenn jackman May 12 '20 at 15:42
  • @glennjackman That is very unfortunate for OP. Personally I think this question clearly belongs to Unix SE as there isn't much programming involved. The issue is probably to understand the finer details of all systems involved. Also, the question is not that much fish-related. The problem would probably occur for other shells too (OP, could you confirm this by using `exec /bin/sh` instead?). However, I retracted my close vote for now. – Socowi May 12 '20 at 16:21
  • With `exec /bin/sh`, I get the standard message about Debian, but then there is no prompt. I also echoed a string righr before exec, that came, but no prompt. From a different tty `ps -A` shows that `sh` is running on the previous tty @Socowi – Arjob Mukherjee May 12 '20 at 17:31

0 Answers0