forked from qt-creator/qt-creator
Terminal: Create Terminal solution
Change-Id: If271fd23a84c49bbc25fcc3b9bc0939c7237d095 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -3,10 +3,13 @@
|
||||
|
||||
#include "shellintegration.h"
|
||||
|
||||
#include "terminalsettings.h"
|
||||
|
||||
#include <utils/environment.h>
|
||||
#include <utils/filepath.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
Q_LOGGING_CATEGORY(integrationLog, "qtc.terminal.shellintegration", QtWarningMsg)
|
||||
@@ -74,9 +77,12 @@ bool ShellIntegration::canIntegrate(const Utils::CommandLine &cmdLine)
|
||||
return false;
|
||||
}
|
||||
|
||||
void ShellIntegration::onOsc(int cmd, const VTermStringFragment &fragment)
|
||||
void ShellIntegration::onOsc(int cmd, std::string_view str, bool initial, bool final)
|
||||
{
|
||||
QString d = QString::fromLocal8Bit(fragment.str, fragment.len);
|
||||
Q_UNUSED(initial);
|
||||
Q_UNUSED(final);
|
||||
|
||||
QString d = QString::fromLocal8Bit(str);
|
||||
const auto [command, data] = Utils::splitAtFirst(d, ';');
|
||||
|
||||
if (cmd == 1337) {
|
||||
@@ -103,6 +109,17 @@ void ShellIntegration::onOsc(int cmd, const VTermStringFragment &fragment)
|
||||
}
|
||||
}
|
||||
|
||||
void ShellIntegration::onBell()
|
||||
{
|
||||
if (settings().audibleBell.value())
|
||||
QApplication::beep();
|
||||
}
|
||||
|
||||
void ShellIntegration::onTitle(const QString &title)
|
||||
{
|
||||
emit titleChanged(title);
|
||||
}
|
||||
|
||||
void ShellIntegration::prepareProcess(Utils::Process &process)
|
||||
{
|
||||
Environment env = process.environment().hasChanges() ? process.environment()
|
||||
|
||||
Reference in New Issue
Block a user