aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/terminal/terminalwidget.cpp
diff options
context:
space:
mode:
authorMarcus Tillmanns <[email protected]>2023-08-18 16:12:06 +0200
committerMarcus Tillmanns <[email protected]>2023-08-21 06:43:01 +0000
commit64b852e18648a9f7501a1c121da404a6cea0858b (patch)
tree2a8b704418d52a552cfdf5a4c030325138c905e5 /src/plugins/terminal/terminalwidget.cpp
parente9b3cd548cd3e9f872344f518c01387dc6af814b (diff)
Terminal: Fix default environment vars
Diffstat (limited to 'src/plugins/terminal/terminalwidget.cpp')
-rw-r--r--src/plugins/terminal/terminalwidget.cpp7
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"))