IDEA-Native-Terminal-Plugin icon indicating copy to clipboard operation
IDEA-Native-Terminal-Plugin copied to clipboard

Alacritty Terminal on Windows (Workaround and potential Fix inside)

Open andgeno opened this issue 6 months ago • 1 comments

I tried to open Alacritty but Native Terminal always spawns a cmd process.

After some debugging I found out that in v0.8.0 the default way of spawning unknown terminal processes does not support spaces in paths. See: this code

On my machine, Alacritty is installed at: C:\Program Files\Alacritty\alacritty.exe. Setting this filepath for Native Terminal to run won't work because of the space in it.

Workaround for Native Terminal v0.8.0

We can avoid using the space and still refer to the correct filepath using a so-called Short Path from the good old 8.3 filename DOS era.

So, the filepath C:\Program Files\Alacritty\alacritty.exe should become C:\Progra~1\Alacritty\alacritty.exe to make it work.

Actual fix for Native Terminal

Replicating the spawn command used in the plugin allows to verify the issue and a potential solution:

  • Original: cmd /c start "C:\Program Files\Alacritty\alacritty.exe"
  • Fixed: cmd /c start "" "C:\Program Files\Alacritty\alacritty.exe"

Let me know if I should submit a PR. Cheers! ;-)

andgeno avatar Aug 09 '24 19:08 andgeno