Closed Mte90 closed 4 years ago
Is mte90
a root user? Try running echo ${EUID}
and see what you get. Also can you please provide the exacts steps to reproduce your issue? Thanks
Regarding the 130 error code that generally indicates that command received a SIGINT... steps for me to reproduce this are also desirable here.
No mte90 is not the root user. That line is from the root user but the trueline file is loaded by the home folder of my user (to avoid duplicates). With the user everything is fine but with root I have this problem.
Can you post the exacts steps for me to reproduce this behaviour? Thanks
Investigate a bit, on this line is_root
is true https://github.com/petobens/trueline/blob/master/trueline.sh#L74 but the next if is not executed.
Seems that on my system the variable $USER
is always the basic user (in my case mte90). Maybe because to became root I usually do a su
from the mte90
user?
About the exit_status I didn't know that was that. I will customize the segments variable to not print it :-)
Seems that on my system the variable $USER is always the basic user (in my case mte90). Maybe because to became root I usually do a su from the mte90 user?
If I only do su
then I also have the $USER
variable set to my non-root
user (pedro
in my case). If I do sudo su
then the $USER
variable is now empty and trueline show root
instead. Mmm I don't know what's the proper behaviour here... I believe the color change (to red) might be enough to indicate that we now have super user privileges? I open to change it though if it isn't clear enough
I prefer to see root, I don't thrust so much the color, maybe add another option to print the root instead the previous user?
The thing is that in order to actually get/set environment variables for the root user you should indeed run sudo su
or su -
(see the -
flag in man su
for details). I think trueline should reflect the active env variables (therefore showing root
when $USER
is not root is a bit confusing). I need to think a bit more about this though
I stand with my previous comment. Closing now.
130
very often as root, maybe is a PID?