Sudo su problem in new Parrot 6

In the new version of Parrot Os when doing:
sudo su

responds with an error

  • Parrot version in use (if you are not aware of it, open terminal and type cat /etc/os-release | grep VERSION):
    $cat /etc/os-release | grep VERSION
    VERSION_ID=“6.0”
    VERSION=“6.0 (lorikeet)”
    VERSION_CODENAME=lory

  • Kernel version (if you are not aware of it, open terminal and type uname -r):
    $uname -a
    Linux parrot 6.5.0-13parrot1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.13-1parrot1 (2023-12-19) x86_64 GNU/Linux

“Solution”
(while the problem is solved with a patch or revision)

Hi @rh3nt0n

It appears this is a recurring bug (reported by @happyoutkast), and I have experienced it myself. Hopefully, a developer or Linux guru will assist.

(I fixed hostname resolution after posting.)

Hello, how did you solve it?

As I read in the query you have cited, do they comment on the lines giving more importance to correct output in the terminal to the output format?
is that so?
thank you

The hostname resolution was a separate issue. I think the Calamares installer may not have set the hostname I chose during installation. In case a developer reads this post, I wanted to make sure they knew that this issue we are experiencing is not due to hostname issues, and reproducible.

┌─[masmer@cracker]─[~]
└──╼ $sudo su
\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\]\342\234\227\[\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then
    echo '\[\]root\[\]@\[\]\h';
else
    echo '\[\]\u\[\]@\[\]\h';
fi)\[\]]\342\224\200[\[\]\w\[\]]
\[\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\]\[\]\$\[\]" - Parrot Terminal\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\]\342\234\227\[\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then
    echo '\[\]root\[\]@\[\]\h';
else
    echo '\[\]\u\[\]@\[\]\h';
fi)\[\]]\342\224\200[\[\]\w\[\]]
\[\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\]\[\]\$\[\]" - Parrot Terminal┌─[root@cracker]─[/home/masmer]
└──╼ #

I think it is simply a problem with the formatting function of that output, something aesthetic that is solved by commenting on the lines I put in the screenshot of the first post.
I understand that it is not the best solution, but the annoying output disappears.
Sorry if I don’t understand well what you posted, I’m a Spanish speaker.

Icono de Validado por la comunidad

Yes, something is wrong with the formatting (syntax) in .bashrc. :+1:

Line 60 and Line 69 are broken. The current syntax makes it very hard to debug and fix. But i accidently found a way to make prompt be flash like LED lol

Stop doing that! :crazy_face:

OH that looks funny lmao. BTW after like an hour debugging, here’s my result: the first character \033 (or \e in short) made the error. IDK why and how. It’s likely not from prompt but something else. It’s possibly from bash or other config file.
I tested with some bashrc files. I tested many other cases that has color escape. That’s everything i see. I’m trying to have a solution.

image
image
Very simple test case.

After looking more closely it seems the simplest solution is not to touch the .bashrc file since there is no problem and just comment out the last line of the bash.bashrc file:

trap 'echo -ne "\033]0;$BASH_COMMAND - Parrot Terminal\007" > /dev/stderr' DEBUG

This situation was already resolved in the previous version of Parrot which occurred after an update (it doesn’t happen to me) I was unaware of this circumstance

The truth is that it looks ugly when you finish installing your new parrot and the terminal gives you such ugly lines when you root… but hey, it is something that is easily solved, fortunately.

I also find the warnings that appear when doing sudo apt update ugly, but that is even easier to solve!
Saludos!