diff options
author | Marcus Tillmanns <[email protected]> | 2024-01-25 07:03:39 +0100 |
---|---|---|
committer | Marcus Tillmanns <[email protected]> | 2024-01-25 12:15:27 +0000 |
commit | 273656c92737909ff915bf91bc22f3371750b399 (patch) | |
tree | 54b9c5407310181be3d742097a2d12a0cb49e809 /src/plugins/terminal/shellintegration.cpp | |
parent | 6d672f7efae08f59a1a47dfc93c82a22eb1fed69 (diff) |
Terminal: Fix fish shell integration
Change-Id: Ib9156be851d092db2a28641a292ae32e76314bec
Reviewed-by: hjk <[email protected]>
Reviewed-by: <[email protected]>
Reviewed-by: Cristian Adam <[email protected]>
Diffstat (limited to 'src/plugins/terminal/shellintegration.cpp')
-rw-r--r-- | src/plugins/terminal/shellintegration.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/terminal/shellintegration.cpp b/src/plugins/terminal/shellintegration.cpp index cc5c50706ea..65b3d86ea00 100644 --- a/src/plugins/terminal/shellintegration.cpp +++ b/src/plugins/terminal/shellintegration.cpp @@ -48,6 +48,10 @@ struct { FilePath script{":/terminal/shellintegrations/shellintegration-clink.lua"}; } clink; + struct + { + FilePath script{":/terminal/shellintegrations/shellintegration.fish"}; + } fish; } filesToCopy; // clang-format on @@ -74,6 +78,9 @@ bool ShellIntegration::canIntegrate(const Utils::CommandLine &cmdLine) if (cmdLine.executable().baseName() == "cmd") return true; + if (cmdLine.executable().baseName() == "fish") + return true; + return false; } @@ -178,6 +185,12 @@ void ShellIntegration::prepareProcess(Utils::Process &process) env.set("CLINK_HISTORY_LABEL", "QtCreator"); env.appendOrSet("CLINK_PATH", tmpRc.parentDir().nativePath(), ";"); + } else if (cmd.executable().baseName() == "fish") { + FilePath xdgDir = FilePath::fromUserInput(m_tempDir.filePath("fish_xdg_data")); + FilePath subDir = xdgDir.resolvePath(QString("fish/vendor_conf.d")); + QTC_ASSERT(subDir.createDir(), return); + filesToCopy.fish.script.copyFile(subDir.resolvePath(filesToCopy.fish.script.fileName())); + env.appendOrSet("XDG_DATA_DIRS", xdgDir.toUserOutput()); } process.setCommand(cmd); |