twolfson / sexy-bash-prompt

Bash prompt with colors, git statuses, and git branches.
MIT License
1.14k stars 155 forks source link

Prompt should not set TERM environment variable #15

Closed rpdelaney closed 11 years ago

rpdelaney commented 11 years ago

Lines 6 to 9 set TERM to "xterm-256color". This has unintended consequences when working within tmux since TERM needs to be "screen-256color" for ncurses applications to function correctly inside tmux.

I have a branch to smarten this up a bit. I will submit a pull request if you like.

However, in my view this is a hack and it is a bad idea in general to manipulate the value of TERM in .bash_prompt. Determining and setting the correct TERM value that is appropriate to the environment is simply not a task of the .bash_prompt. Rather, .bash_prompt should read TERM and set PS1 accordingly, and users should be expected to set their own TERM correctly in .bashrc.

twolfson commented 11 years ago

Ah, good catch. That is legacy from the fork and I would be okay with scrapping those lines.

I am not sure what you mean by "smartening this up" but would be interested in taking a look.

In the end, scrapping is usually better than trying to predict user behavior.

rpdelaney commented 11 years ago

My "smartening" was to add a layer of hack so that it didn't wreck my personal TERM. But it sounds like we agree that the ideal behavior would be to avoid interacting with TERM completely.