diff options
author | Marcus Tillmanns <[email protected]> | 2024-04-30 08:33:48 +0200 |
---|---|---|
committer | Marcus Tillmanns <[email protected]> | 2024-04-30 07:11:01 +0000 |
commit | 8b682ac7f55d3762875631df21ec28ff9d0a7669 (patch) | |
tree | 893a7c33f3db8a576d04f5df1639d9fca836b9e2 /src/plugins/terminal/terminalwidget.cpp | |
parent | 84f0f6ba8b40378d0cf9fe743c75c1a58fc2bb41 (diff) |
Terminal: Fix TERM env variable
Some (Fedora) OS/Distros set a default value for TERM such as "dumb", which then breaks
command line tools such as "clear" which try to figure out what terminal they are
running in. Therefore we have to force-set our own TERM value.
Fixes: QTCREATORBUG-30737
Change-Id: I50ac86f17c92dc7bc477cc59ed43ec22025593fb
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/terminal/terminalwidget.cpp')
-rw-r--r-- | src/plugins/terminal/terminalwidget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 756f1a11bee..c7bdab9b2a8 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -119,8 +119,12 @@ void TerminalWidget::setupPty() Environment env = m_openParameters.environment.value_or(Environment{}) .appliedToEnvironment(shellCommand.executable().deviceEnvironment()); + // Some OS/Distros set a default value for TERM such as "dumb", which then breaks + // command line tools such as "clear" which try to figure out what terminal they are + // running in. Therefore we have to force-set our own TERM value here. + env.set("TERM", "xterm-256color"); + // Set some useful defaults - env.setFallback("TERM", "xterm-256color"); env.setFallback("TERM_PROGRAM", QCoreApplication::applicationName()); env.setFallback("COLORTERM", "truecolor"); env.setFallback("COMMAND_MODE", "unix2003"); |