Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt should not set TERM environment variable #15

Closed
rpdelaney opened this issue Nov 25, 2013 · 2 comments
Closed

Prompt should not set TERM environment variable #15

rpdelaney opened this issue Nov 25, 2013 · 2 comments

Comments

@rpdelaney
Copy link
Collaborator

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
Copy link
Owner

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
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants