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

Consider clearing the TERM variable #43

Closed
rprichard opened this issue Oct 15, 2015 · 5 comments
Closed

Consider clearing the TERM variable #43

rprichard opened this issue Oct 15, 2015 · 5 comments

Comments

@rprichard
Copy link
Owner

See #23. Clearing the TERM and PAGER variables fixed that problem, but perhaps winpty's console.exe utility ought to clear TERM. This behavior probably doesn't belong in the agent or DLL.

I don't think winpty should be clearing PAGER, even though it was necessary to fix #23.

@rprichard
Copy link
Owner Author

I noticed that both IntelliJ and Eclipse set TERM on Windows. IntelliJ sets it to xterm-256color and Eclipse's TM Terminal plugin sets it to xterm.

@CMCDragonkai
Copy link

Perhaps, alias console="env TERM= PAGER= console"? Or some variation of that?

@rprichard
Copy link
Owner Author

Perhaps, alias console="env TERM= PAGER= console"? Or some variation of that?

That command should typically do the right thing, given IronPython's behavior as of July 2014. I'm a bit suspicious of that IronPython behavior, but it was almost two years ago, so maybe it's changed.

Clearing TERM like that is a bit dodgy. If a Cygwin program (like console.exe) is started inside a Windows console, and if TERM is unset, then Cygwin itself apparently sets TERM to cygwin automatically at startup. This scenario shouldn't typically happen, though, because there's little reason to run console.exe inside an already-existing console.

I think a good argument can be made that winpty itself ought to clear TERM, though, and do so by default. winpty creates a console and adapts its I/O to the outer terminal, which is frequently TERM=xterm, but could be something else. It's plausible that winpty could someday examine the outer TERM variable to adjust the translation (to deal with this issue, for example), and if it does, then env TERM= console will communicate the wrong information to winpty. Regardless, the program running under winpty should not see TERM=xterm, because it's not meaningfully connected to an xterm--it's connected to a Windows console.

In other words, when console.exe is starting, the TERM variable should indicate the kind of terminal that winpty is running under, and when the program under winpty starts, its TERM should be clear, because it's not running under a Unix-like terminal.

@rprichard
Copy link
Owner Author

rprichard added a commit to rprichard/jediterm that referenced this issue May 21, 2016
rprichard added a commit to rprichard/jediterm that referenced this issue May 31, 2016
rprichard added a commit to rprichard/jediterm that referenced this issue Jun 3, 2016
@rprichard
Copy link
Owner Author

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

No branches or pull requests

2 participants