forked from qt-creator/qt-creator
Terminal: Fix fish shell integration
Change-Id: Ib9156be851d092db2a28641a292ae32e76314bec Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -48,6 +48,10 @@ struct
|
|||||||
{
|
{
|
||||||
FilePath script{":/terminal/shellintegrations/shellintegration-clink.lua"};
|
FilePath script{":/terminal/shellintegrations/shellintegration-clink.lua"};
|
||||||
} clink;
|
} clink;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
FilePath script{":/terminal/shellintegrations/shellintegration.fish"};
|
||||||
|
} fish;
|
||||||
|
|
||||||
} filesToCopy;
|
} filesToCopy;
|
||||||
// clang-format on
|
// clang-format on
|
||||||
@@ -74,6 +78,9 @@ bool ShellIntegration::canIntegrate(const Utils::CommandLine &cmdLine)
|
|||||||
if (cmdLine.executable().baseName() == "cmd")
|
if (cmdLine.executable().baseName() == "cmd")
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (cmdLine.executable().baseName() == "fish")
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,6 +185,12 @@ void ShellIntegration::prepareProcess(Utils::Process &process)
|
|||||||
|
|
||||||
env.set("CLINK_HISTORY_LABEL", "QtCreator");
|
env.set("CLINK_HISTORY_LABEL", "QtCreator");
|
||||||
env.appendOrSet("CLINK_PATH", tmpRc.parentDir().nativePath(), ";");
|
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);
|
process.setCommand(cmd);
|
||||||
|
Reference in New Issue
Block a user