Commit b0d3d83e authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

Export KONSOLE_VERSION as an environment variable

Summary:
The env var is exported as a numeric string (by removing the dots from
the version string), this has the benefit of making it simpler to compare
the version in shell arithmetic expressions.

This should help programms like neovim check if konsole has support
for terminal capabilities (e.g. DECSCUSR) by using a condition that
checks the konsole version. See also:
https://github.com/neovim/neovim/issues/8300

CCBUG: 347323

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12621
parent 20581971
......@@ -195,6 +195,7 @@ void SessionManager::applyProfile(Session *session, const Profile::Ptr profile,
QStringList environment = profile->environment();
environment << QStringLiteral("PROFILEHOME=%1").arg(profile->defaultWorkingDirectory());
environment << QStringLiteral("KONSOLE_PROFILE_NAME=%1").arg(profile->name());
environment << QStringLiteral("KONSOLE_VERSION=%1").arg(QStringLiteral(KONSOLE_VERSION).remove(QLatin1String(".")));
session->setEnvironment(environment);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment