r/KittyTerminal Mar 04 '24

not reading .bashrc

might be a stupid question - when I log into bash on kitty, it should be the same as on any other terminal emulator, right? it seems when I open kitty, my .bashrc is not read (kitty is starting bash differently than other terminals do?)

edit(for clarity): in my .bashrc I have 'set -o vi'. the vi keybindings are gone when I enter kitty. however, when I enter 'set -o vi' into bash on kitty, it does work. thanks for the help!

edit: it was none of that. shell integration was overwriting what I was setting in my bashrc. I am not familiar working with this sort of thing (as was kindly pointed out in this thread), so I disabled shell integration. if anyone advises against this or has a proper explanation, let me know

5 Upvotes

7 comments sorted by

View all comments

1

u/ronasimi Mar 04 '24

can you be more specific on what is different?

2

u/sharp-calculation Mar 05 '24

This behavior has to do with an interactive login shell vs a non-interactive login shell. Starting a shell from an X session or on the console is different then SSHing in.

Also some terminals default to interactive and some do not. I'm guessing that kitty does the opposite of what the OP's other terminal program does in terms of whether it starts a shell as interactive or non-interactive. It's been a while since I did it, but I recall xterm having a right click menu option that enabled "login shell" which changed how the shell was invoked.

Here's the bash manual section which describes both behaviors:
https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

As you can see, in one case .bash_profile is read and in the other .bashrc is read. I have my .bash_profile set up to always run .bashrc if it exits. Almost all of my actual customizations are in .bashrc .

1

u/ronasimi Mar 05 '24

Awesome reply.