2023-03-10 13:55:17 +01:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH
|
|
|
|
|
// Qt-GPL-exception-1.0
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <utils/commandline.h>
|
2023-05-03 17:05:35 +02:00
|
|
|
#include <utils/process.h>
|
2023-03-10 13:55:17 +01:00
|
|
|
|
2023-07-17 13:51:56 +02:00
|
|
|
#include <solutions/terminal/surfaceintegration.h>
|
2023-03-10 13:55:17 +01:00
|
|
|
|
|
|
|
|
#include <QTemporaryDir>
|
|
|
|
|
|
|
|
|
|
namespace Terminal {
|
|
|
|
|
|
2023-07-17 13:51:56 +02:00
|
|
|
class ShellIntegration : public QObject, public TerminalSolution::SurfaceIntegration
|
2023-03-10 13:55:17 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
static bool canIntegrate(const Utils::CommandLine &cmdLine);
|
|
|
|
|
|
2023-07-17 13:51:56 +02:00
|
|
|
void onOsc(int cmd, std::string_view str, bool initial, bool final) override;
|
|
|
|
|
void onBell() override;
|
|
|
|
|
void onTitle(const QString &title) override;
|
2023-03-10 13:55:17 +01:00
|
|
|
|
2023-05-03 16:00:22 +02:00
|
|
|
void prepareProcess(Utils::Process &process);
|
2023-03-10 13:55:17 +01:00
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void commandChanged(const Utils::CommandLine &command);
|
|
|
|
|
void currentDirChanged(const QString &dir);
|
2023-07-17 13:51:56 +02:00
|
|
|
void titleChanged(const QString &title);
|
2023-03-10 13:55:17 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QTemporaryDir m_tempDir;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Terminal
|