p-e-w / finalterm

At last – a modern terminal emulator (NO LONGER MAINTAINED)
http://finalterm.org
GNU General Public License v3.0
3.84k stars 179 forks source link

Finalterm does not highlight files and directories #320

Closed mrDoctorWho closed 9 years ago

mrDoctorWho commented 10 years ago

Finalterm does not highlight files and directories after changing user by sudo. Sorry if this is a duplicate.

p-e-w commented 9 years ago

sudo spawns another instance of bash without Final Term being able to inject its logic into it. I see no way to fix this short of patching bash. You can, however, replace the user's .bashrc with Final Term's bash_startup as a workaround. That way, the hooks get executed whenever a bash shell is spawned from that user's account – unfortunately, also in other terminal emulators.

nashley commented 9 years ago

@p-e-w Perhaps only run the necessary changes in .bashrc if the current terminal is finalterm. This could be accomplished by interacting with the window manager -- could it not?

p-e-w commented 9 years ago

Final Term could set an environment variable (IS_FINALTERM), but indeed all .bashrc needs to do is examine bash's parent process (and if that is bash again, its grandparent process and so on). This could be written as, say, a Python script with ease and probably even in bashscript directly.