How to reinitialize a terminal window instead of closing it and starting a new one?
If you mean reloading your .bashrc configuration then:
source ~/.bashrc
For less typing, you can replace source
with a dot: . ~/.bashrc
Some Addition i found in the manpage from the reset/tset command
tset reset terminal intialization
command: reset
Tset initializes terminals. Tset first determines the type of terminal that you are using. This determination is done as follows, using the first terminal type found.
an advantage seems to be, that it's independent from the used shell. also works with fish here.
So to reinitialize any terminal just do-
$ tset
OR
$ reset
An additional option to the exec bash
is that if you changed your .profile
(or .bash_profile
), you can do
$ exec bash --login
That will read your profile again as well. It wouldn't hurt to add the -i
option as well to explicitly tell bash that this is an interactive shell, but it can normally figure that out for itself.