3
┌──(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.

9
  • I have Kali 2020.4 VM here; Kernel 5.8.0. I use Xfce and Terminal is 0.14.1 . It is all single line. What version of Terminal are you using?
    – anon
    Commented Nov 20, 2020 at 13:03
  • @gronostaj I tried changing it in my ~/.bashrc or ~/.bash.bashrc with my user or with root, when I change it in script so that script does not contain \n (new line) still does not work, even if I delete whole code terminal still stays the same
    – yamizone
    Commented Nov 20, 2020 at 15:33
  • @John Im not quite sure how to get that info when I do uname -r I get this info "5.9.0-kali1-amd64" And when I do my dmesg | grep Linux I get this info "Linux version 5.9.0-kali1-amd64 ([email protected]) (gcc-10 (Debian 10.2.0-15) 10.2.0, GNU ld (GNU Binutils for Debian) 2.35.1) #1 SMP Debian 5.9.1-1kali2 (2020-10-29)" I'am using VMware Kali
    – yamizone
    Commented Nov 20, 2020 at 15:33
  • What you see appears to be the new approach for new installs. kali.org/news/kali-linux-2020-4-release I upgraded in place, so my terminal has not changed.
    – anon
    Commented Nov 20, 2020 at 15:40
  • 1
    @John yeah so far I understand that they just said how to get new look of the terminal not how to revert it, new line in terminal is bugging me so much
    – yamizone
    Commented Nov 20, 2020 at 15:44

7 Answers 7

4

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.

0
4

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!

0
1

Kali has very simple command utility for this purpose:

kali-tweaks

source:

https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/```
1
  • Can you elaborate on this?
    – Toto
    Commented Mar 20, 2022 at 16:03
1

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

0xfk :kali prompt config 0xfk

0xfk :kali prompt oneline

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

enter image description here

enter image description here

enter image description here

0

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

1
  • 2
    The order of answers is not fixed, therefore "the above answer" does not describe any specific answer. Commented Jan 3, 2022 at 6:48
0

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:~#
4
  • 1
    Do not edit /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
  • Hey @KamilMaciorowski I respect your caution, but can you explain why? Is it just to better avoid typos in the passwd or is there some other reason?
    – JayRugMan
    Commented Jan 4, 2022 at 16:34
  • I'm always careful... been doing this for over a decade without an issue.. both privately and professionally, on dozens of systems. (shh... I also log into root more than I use sudo - don't tell the Linux gods).
    – JayRugMan
    Commented Feb 10, 2023 at 19:07
  • First, 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)
    – gildux
    Commented Mar 4, 2023 at 18:35
0

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.

img1: in dot zshrc config file img2: observable change on terminal interface

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .