forked from qt-creator/qt-creator
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 <christian.stenger@qt.io>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user