Use literal quoting for titles

This commit is contained in:
crschnick committed 2026-10-03 18:14:24 +00:00
1 parent d7bef0595e
commit 3af74964de
9 files changed
+25 -26

No files matched your search

@@ -57,7 +57,7 @@ public interface AlacrittyTerminalType extends ExternalTerminalType, TrackableTe
var b = CommandBuilder.of()
.add("alacritty")
.add("-t")
.addQuoted(configuration.getCleanTitle())
.addLiteral(configuration.getCleanTitle())
.add("-e")
.add(scriptOpenCommand);
@@ -109,7 +109,7 @@ public interface AlacrittyTerminalType extends ExternalTerminalType, TrackableTe
public void launch(TerminalLaunchConfiguration configuration) throws Exception {
var b = CommandBuilder.of()
.add("-t")
.addQuoted(configuration.getCleanTitle())
.addLiteral(configuration.getCleanTitle())
.add("-e")
.addFile(configuration.single().getScriptFile());
launch(b);
@@ -140,7 +140,7 @@ public interface AlacrittyTerminalType extends ExternalTerminalType, TrackableTe
.add("open", "-a")
.addQuoted("Alacritty.app")
.add("-n", "--args", "-t")
.addQuoted(configuration.getCleanTitle())
.addLiteral(configuration.getCleanTitle())
.add("-e")
.addFile(configuration.single().getScriptFile()));
}
@@ -40,7 +40,7 @@ public class CustomTerminalType implements ExternalApplicationType, ExternalTerm
format, "CMD", configuration.single().getScriptFile().toString(), true);
// We can't be sure whether the command is blocking or not, so always make it not blocking
if (sc.getOsType() == OsType.WINDOWS) {
toExecute = CommandBuilder.of().add("start").addQuoted(configuration.getCleanTitle()).add(toExecute).buildFull(sc);
toExecute = CommandBuilder.of().add("start").addLiteral(configuration.getCleanTitle()).add(toExecute).buildFull(sc);
} else {
var async = sc.getShellDialect().launchAsync(CommandBuilder.of().add(toExecute), true);
toExecute = async.buildFull(sc);
@@ -92,7 +92,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
protected CommandBuilder toCommand(TerminalLaunchConfiguration configuration) {
return CommandBuilder.of()
.add("-T")
.addQuoted(configuration.getCleanTitle())
.addLiteral(configuration.getCleanTitle())
.add("-e")
.add(configuration.single().getDialectLaunchCommand());
}
@@ -124,7 +124,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
return CommandBuilder.of()
.addIf(configuration.isPreferTabs(), "--tab")
.add("--title")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.add("--command")
.addFile(configuration.single().getScriptFile());
}
@@ -154,7 +154,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
protected CommandBuilder toCommand(TerminalLaunchConfiguration configuration) {
return CommandBuilder.of()
.add("-t")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.add("-e")
.addFile(configuration.single().getScriptFile());
}
@@ -215,7 +215,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
protected CommandBuilder toCommand(TerminalLaunchConfiguration configuration) {
return CommandBuilder.of()
.add("-t")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.add("-e")
.addFile(configuration.single().getScriptFile());
}
@@ -247,7 +247,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
.add("-e")
.addFile(configuration.single().getScriptFile())
.add("-T")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.addIf(configuration.isPreferTabs(), "--new-tab");
}
};
@@ -277,7 +277,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
return CommandBuilder.of()
.addIf(!configuration.isPreferTabs(), "-s")
.add("-T")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.add("-2")
.add("-e")
.addFile(configuration.single().getScriptFile());
@@ -315,7 +315,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
return CommandBuilder.of()
.add("-n", "~")
.add("-r")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.add("-e")
.addFile(configuration.single().getScriptFile());
}
@@ -402,7 +402,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
protected CommandBuilder toCommand(TerminalLaunchConfiguration configuration) {
return CommandBuilder.of()
.add("-title")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.add("-e")
.addFile(configuration.single().getScriptFile());
}
@@ -35,7 +35,7 @@ public class FootTerminalType implements ExternalTerminalType, ExternalApplicati
public void launch(TerminalLaunchConfiguration configuration) throws Exception {
var toExecute = CommandBuilder.of()
.add("--title")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.addFile(configuration.single().getScriptFile());
launch(toExecute);
}
@@ -37,7 +37,7 @@ public class GnomeTerminalType implements ExternalApplicationType.PathApplicatio
var toExecute = CommandBuilder.of()
.add(getExecutable(), "-v", "--title")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.add("--")
.addFile(configuration.single().getScriptFile())
// In order to fix this bug which also affects us:
@@ -32,7 +32,7 @@ public class PtyxisTerminalType implements ExternalApplicationType.LinuxApplicat
.addIf(configuration.isPreferTabs(), "--tab")
.addIf(!configuration.isPreferTabs(), "--new-window")
.add("--title")
.addQuoted(configuration.getColoredTitle())
.addLiteral(configuration.getColoredTitle())
.add("--")
.add(configuration.single().getDialectLaunchCommand());
launch(toExecute);
@@ -166,7 +166,7 @@ public interface WezTerminalType extends ExternalTerminalType, TrackableTerminal
.add(base)
.add("cli", "set-tab-title")
.add("--pane-id", paneId)
.addQuoted(configuration.getColoredTitle());
.addLiteral(configuration.getColoredTitle());
titleCommand.fixedEnvironment("WEZTERM_UNIX_SOCKET", activeSocket.get().toString());
LocalShell.getShell()
.command(titleCommand)
@@ -77,7 +77,7 @@ public interface WindowsTerminalType extends ExternalTerminalType, TrackableTerm
splitIterator.getSplitDirection() == TerminalSplitStrategy.SplitDirection.HORIZONTAL,
"--vertical");
}
cmd.add("--title").addQuoted(getFixedTitle(configuration.getColoredTitle()));
cmd.add("--title").addLiteral(getFixedTitle(configuration.getColoredTitle()));
cmd.add("--profile").addQuoted("{021eff0f-b38a-45f9-895d-41467e9d510f}");
cmd.add(scriptOpenCommand);
@@ -74,8 +74,8 @@ public class ZellijTerminalMultiplexer implements TerminalMultiplexer {
config.getPanes().getFirst().getDialectLaunchCommand().buildSimple();
l.addAll(List.of(
"zellij attach --create-background xpipe",
"zellij -s xpipe action new-tab --name \"" + escape(control, config.getColoredTitle(), false, true)
+ "\"",
"zellij -s xpipe action new-tab --name "
+ control.getShellDialect().literalArgument(config.getColoredTitle()),
"zellij -s xpipe action write-chars -- " + escape(control, " " + firstCommand, true, true)
+ getCommandExitLiteral(control),
"zellij -s xpipe action clear",
@@ -95,9 +95,8 @@ public class ZellijTerminalMultiplexer implements TerminalMultiplexer {
: "--direction down";
l.addAll(List.of(
"zellij -s xpipe action new-pane " + directionString
+ " --name \""
+ escape(control, config.getPanes().get(i).getTitle(), false, true)
+ "\"",
+ " --name "
+ control.getShellDialect().literalArgument(config.getPanes().get(i).getTitle()),
"zellij -s xpipe action write-chars -- " + escape(control, " " + iCommand, true, true)
+ getCommandExitLiteral(control),
"zellij -s xpipe action clear",
@@ -158,8 +157,8 @@ public class ZellijTerminalMultiplexer implements TerminalMultiplexer {
var pause = getPauseTiming();
asyncLines.addAll(List.of(
"sleep " + pause,
"zellij -s xpipe action new-tab --name \"" + escape(control, config.getColoredTitle(), false, true)
+ "\"",
"zellij -s xpipe action new-tab --name "
+ control.getShellDialect().literalArgument(config.getColoredTitle()),
"sleep " + pause,
"zellij -s xpipe action go-to-tab 2",
"sleep " + pause,
@@ -182,8 +181,8 @@ public class ZellijTerminalMultiplexer implements TerminalMultiplexer {
? "--direction right"
: "--direction down";
asyncLines.addAll(List.of(
"zellij -s xpipe action new-pane " + directionString + " --name \""
+ escape(control, config.getPanes().get(i).getTitle(), false, true) + "\"",
"zellij -s xpipe action new-pane " + directionString + " --name "
+ control.getShellDialect().literalArgument(config.getPanes().get(i).getTitle()),
"zellij -s xpipe action write-chars -- " + escape(control, " " + iCommand, true, true)
+ getCommandExitLiteral(control),
"zellij -s xpipe action clear",