┌──(kali㉿kali)-[~]
└─$
I want this to be in one line on terminal like it was before I updated kali. I tried changing bashrc on kali user and on root user there was no update.
┌──(kali㉿kali)-[~]
└─$
I want this to be in one line on terminal like it was before I updated kali. I tried changing bashrc on kali user and on root user there was no update.
Edit your .zshrc
file and change the variable PROMPT like so:
PROMPT=$'%F{%(#.blue.green)}${debian_chroot:+($debian_chroot)──}(%B%F{%(#.yellow.blue)}%n%(#.💀.㉿)%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]%B%(#.%F{yellow}#.%F{blue}$)%b%F{reset} '
You can also get rid of the newline between prompts. Just change this variable to "no":
new_line_before_prompt=no
While I was at it I also changed the color red to yellow, because It was popping out too much to me.
In order for the changes to take effect you must restart the Terminal or execute source ~/.zshrc
.
Very easy solution! Type in the terminal kali-tweaks
, then go to shell and prompt
then configure prompt
move cursor to one line
and press space then apply and you’re done!
Kali has very simple command utility for this purpose:
kali-tweaks
source:
https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/```
Three options are there so you can choose your preferred configuration, as depicted below first, edit the zshrc with your favorite editor; after that, replace the PROMPT_ALTERNATIVE and NEWLINE_BEFORE_PROMPT accordingly.
$ nano ~/.zshrc
When done refresh the terminal to apply the new changes
$ source ~/.zshrc
Second option as highlighted by @user1678412 is to use kali-tweaks following the steps below:
$ kali-tweaks
In addition to the above answer, if you would like to revert to a simple one liner (without blue brackets and parentheses or icons):
nano ~/.zshrc
Then edit the line to be
PROMPT='${debian_chroot:+($debian_chroot)}%B%F{%(#.red.blue)}%n%(#.@.@)%m%b%F{reset}:%B%(6~.%-1~/…/%4~.%5~)%b%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
Would also recommend turning off $new_line_before_prompt
Another option is to use bash instead of zsh. Since you already edited the .bashrc
file, just run bash
in the prompt to test your edits. To make permanent, you can edit /etc/passwd
, making /usr/bin/bash
your default shell:
┌──(root💀blackbox01)-[~]
└─# vim /etc/passwd
...
root:x:0:0:root:/root:/bin/bash ##<< instead of /usr/bin/zsh
...
### reboot
...
root@blackbox01:~#
root@blackbox01:~#
/etc/passwd
by hand. Use chsh
to change your login shell. If you really need to edit passwd
then do it with vipw
.
Commented
Jan 3, 2022 at 6:44
chsh
and alike are usable by users on their own account (hence no need to switch to root
or use sudo
and alike.) Second, those tools and vipw
(that also checks that the format isn't broken) take care of backup and shadow files (plus the distro specifics)
In ~/.zshrc
there's a kali config variable named PROMPT_ALTERNATIVE
, possible values oneline, twoline (default value) and a keybinding ^P
(Ctrl+P) is associated with it.
Using this one can toggle between the two possible alternatives.