mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 15:10:23 +00:00
Logging fixes
This commit is contained in:
parent
63bef7161a
commit
8a964cadad
1 changed files with 16 additions and 2 deletions
|
@ -131,9 +131,23 @@ public class TerminalLauncher {
|
||||||
entry != null ? color : null, adjustedTitle, cleanTitle, ps, ShellDialects.POWERSHELL);
|
entry != null ? color : null, adjustedTitle, cleanTitle, ps, ShellDialects.POWERSHELL);
|
||||||
return config;
|
return config;
|
||||||
} else {
|
} else {
|
||||||
|
var found = sc.command(sc.getShellDialect().getWhichCommand("script")).executeAndCheck();
|
||||||
|
if (!found) {
|
||||||
|
var suffix = sc.getOsType() == OsType.MACOS ? "This command is available in the util-linux package which can be installed via homebrew." : "This command is available in the util-linux package.";
|
||||||
|
throw ErrorEvent.expected(new IllegalStateException("Logging requires the script command to be installed. " + suffix));
|
||||||
|
}
|
||||||
|
|
||||||
var content = sc.getOsType() == OsType.MACOS || sc.getOsType() == OsType.BSD ?
|
var content = sc.getOsType() == OsType.MACOS || sc.getOsType() == OsType.BSD ?
|
||||||
"script -q \"%s\" \"%s\"".formatted(logFile, preparationScript) :
|
"""
|
||||||
"script --quiet --command \"%s\" \"%s\"".formatted(preparationScript, logFile);
|
echo "Transcript started, output file is sessions/%s"
|
||||||
|
script -e -q "%s" "%s"
|
||||||
|
echo "Transcript stopped, output file is sessions/%s"
|
||||||
|
""".formatted(logFile.getFileName(), logFile, preparationScript, logFile.getFileName()) :
|
||||||
|
"""
|
||||||
|
echo "Transcript started, output file is sessions/%s"
|
||||||
|
script --quiet --command "%s" "%s"
|
||||||
|
echo "Transcript stopped, output file is sessions/%s"
|
||||||
|
""".formatted(logFile.getFileName(), preparationScript, logFile, logFile.getFileName());
|
||||||
var ps = ScriptHelper.createExecScript(sc.getShellDialect(), sc, content);
|
var ps = ScriptHelper.createExecScript(sc.getShellDialect(), sc, content);
|
||||||
var config = new ExternalTerminalType.LaunchConfiguration(
|
var config = new ExternalTerminalType.LaunchConfiguration(
|
||||||
entry != null ? color : null, adjustedTitle, cleanTitle, ps, sc.getShellDialect());
|
entry != null ? color : null, adjustedTitle, cleanTitle, ps, sc.getShellDialect());
|
||||||
|
|
Loading…
Reference in a new issue