diff options
author | Marcus Tillmanns <[email protected]> | 2023-08-18 16:12:06 +0200 |
---|---|---|
committer | Marcus Tillmanns <[email protected]> | 2023-08-21 06:43:01 +0000 |
commit | 64b852e18648a9f7501a1c121da404a6cea0858b (patch) | |
tree | 2a8b704418d52a552cfdf5a4c030325138c905e5 /src/plugins/terminal/terminalwidget.cpp | |
parent | e9b3cd548cd3e9f872344f518c01387dc6af814b (diff) |
Terminal: Fix default environment vars
Fixes: QTCREATORBUG-29515
Change-Id: I1d14f228f946a64a8d3cdb17f57ae9058db549ff
Reviewed-by: Cristian Adam <[email protected]>
Diffstat (limited to 'src/plugins/terminal/terminalwidget.cpp')
-rw-r--r-- | src/plugins/terminal/terminalwidget.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index dd105223536..a2c566c8f0a 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -149,6 +149,13 @@ void TerminalWidget::setupPty() Environment env = m_openParameters.environment.value_or(Environment{}) .appliedToEnvironment(shellCommand.executable().deviceEnvironment()); + // Set some useful defaults + env.setFallback("TERM", "xterm-256color"); + env.setFallback("TERM_PROGRAM", QCoreApplication::applicationName()); + env.setFallback("COLORTERM", "truecolor"); + env.setFallback("COMMAND_MODE", "unix2003"); + env.setFallback("INIT_CWD", QCoreApplication::applicationDirPath()); + // For git bash on Windows env.prependOrSetPath(shellCommand.executable().parentDir()); if (env.hasKey("CLINK_NOAUTORUN")) |