Skip to content

Commit a70e0bf

Browse files
authored
Revert "only override TERM if its not previously set" (#119)
add comments explaining why
1 parent fba938d commit a70e0bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

terminado/management.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def preexec_fn():
2828

2929
ENV_PREFIX = "PYXTERM_" # Environment variable prefix
3030

31+
# TERM is set according to xterm.js capabilities
3132
DEFAULT_TERM_TYPE = "xterm-256color"
3233

3334

@@ -172,8 +173,9 @@ def __init__(self, shell_command, server_url="", term_settings={},
172173
def make_term_env(self, height=25, width=80, winheight=0, winwidth=0, **kwargs):
173174
"""Build the environment variables for the process in the terminal."""
174175
env = os.environ.copy()
175-
if "TERM" not in env or "type" in self.term_settings:
176-
env["TERM"] = self.term_settings.get("type", DEFAULT_TERM_TYPE)
176+
# ignore any previously set TERM
177+
# TERM is set according to xterm.js capabilities
178+
env["TERM"] = self.term_settings.get("type", DEFAULT_TERM_TYPE)
177179
dimensions = "%dx%d" % (width, height)
178180
if winwidth and winheight:
179181
dimensions += ";%dx%d" % (winwidth, winheight)

0 commit comments

Comments
 (0)