From a395e55c922f722872ea66584ef6da0a267cb988 Mon Sep 17 00:00:00 2001 From: Christian Jansen Date: Tue, 13 Oct 2026 00:34:16 -0400 Subject: [PATCH 1/2] Add args handling for opening macOS terminal Adds a very naive handler for `args` (which was previously the unused `string _` in the `OpenTerminal()` function signature) to allow for "weird" terminals like Alacritty which require the starting directory to be set via a commandline option (`--working-directory` in Alacritty's case). Critically, this is a simple, naive handling of `args`. Since the `open` command doesn't process anything after the `--args` flag, this setup requires a macOS terminal integration that sets `args` to also set the terminal's starting directory via those `args`. Personally, I think both the macOS and Linux implementations of `OpenTerminal` could do with more robust CLI parsing (which I'm happy to take a first pass at), but I felt it was outside the purpose of this branch. --- src/Native/MacOS.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Native/MacOS.cs b/src/Native/MacOS.cs index c289ea67ac..809768eb9e 100644 --- a/src/Native/MacOS.cs +++ b/src/Native/MacOS.cs @@ -118,9 +118,13 @@ public void OpenInFileManager(string path) Process.Start("open", $"{path.Quoted()} -R"); } - public void OpenTerminal(string workdir, string _) + public void OpenTerminal(string workdir, string args) { - Process.Start("open", $"-a {OS.ShellOrTerminal} {workdir.Quoted()}"); + if (string.IsNullOrEmpty(args)) { + Process.Start("open", $"-a {OS.ShellOrTerminal} {workdir.Quoted()}"); + } else { + Process.Start("open", $"-a {OS.ShellOrTerminal} --args {args} {workdir.Quoted()}"); + } } public void OpenWithDefaultEditor(string file) From cb8ca614928cc6f4167f561b230f2aa2c144209e Mon Sep 17 00:00:00 2001 From: Christian Jansen Date: Tue, 13 Oct 2026 00:42:51 -0400 Subject: [PATCH 2/2] Add Alacritty Terminal support for macOS Adds integration support for the Alacritty terminal on macOS. Alacritty is cross-platform and available for Windows and Linux as well, so adding support on those platforms should be trivial, but this is the platform I wanted it and could test it for. I tested this on my MacBook Pro both with the Alacritty terminal and with the default macOS Terminal to ensure compatibility with existing integrations. Alacritty differs slightly from other macOS terminals in that it doesn't allow setting the starting directory through `open` with `open -a Alacritty /path/to/dir`; instead, you have to set the starting directory using Alacritty's `--working-directory` CLI option, resulting in something along the lines of `open -a Alacritty --args --working-directory /path/to/dir`. Thus, adding support for Alacritty also required adding support for passing arguments to terminals on macOS, at least at a naive level. --- src/Models/ShellOrTerminal.cs | 1 + .../Images/ShellIcons/alacritty-term.png | Bin 0 -> 3612 bytes 2 files changed, 1 insertion(+) create mode 100644 src/Resources/Images/ShellIcons/alacritty-term.png diff --git a/src/Models/ShellOrTerminal.cs b/src/Models/ShellOrTerminal.cs index e8e5854754..fb94f31967 100644 --- a/src/Models/ShellOrTerminal.cs +++ b/src/Models/ShellOrTerminal.cs @@ -48,6 +48,7 @@ static ShellOrTerminal() new ShellOrTerminal("otty", "Otty", "Otty"), new ShellOrTerminal("cmux", "cmux", "cmux"), new ShellOrTerminal("mux0", "mux0", "mux0"), + new ShellOrTerminal("alacritty-term", "Alacritty", "Alacritty", "--working-directory"), }; } else diff --git a/src/Resources/Images/ShellIcons/alacritty-term.png b/src/Resources/Images/ShellIcons/alacritty-term.png new file mode 100644 index 0000000000000000000000000000000000000000..b8117882848a00a1c27ffae08af48db5d14da946 GIT binary patch literal 3612 zcmZ{ncRbba`^Vph93mql>ttqR9(xPfdnMyIiV(7eW1W*#ga`>oL^(z>Pxek$MkJ%p zu}9|NWb5!f_22K0-}Cjjuh-)q*M0qU-;euFFgMksrRJap0D#s&U)z%88h;xDm=sS> zD)LBn$z9V#69B4T(EPbiLF)6k=v$fqK$su^pkhg@NJFS!0Pq+J02}uJK>0NQu==5! zEL2GoU}qyeZIY8Xx!sH;*=0X{yFilP``328v_?p!xeT;5twU$FVGib2cUjL(hYhsI zUgyGe-oiawlkBrS9Xbk~CCRzyw{n_!iYzAPwNsQ&*!NbC zo9bMzK$RRs-$9lX3WK5tH_%M9H##FEX@U>!!nbRGz{4wAkES&s z{-5`jqZ!LO{2Lol)}GiVn1KRJyjn-6;fSy+&PO3LhP<7`9vHirf2=Z zpE<%1eu&uowT8U~8o;`K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