Chris Bouchard

Results 32 comments of Chris Bouchard

I find this answer very confusing. I hope I can explain why. >Alacritty does indeed not pass quotes to the shell program executed, if they are 'top level' quotes. >...

Could this be a bug in the Windows build? I don't think it's the multiple shells, because WSL also forwards its arguments. I've attached a couple screenshots with what I'm...

@chrisduerr: That does explain what I'm seeing, thank you. It's nothing to do with shell quoting, it's just that the Windows version doesn't follow the same rules. I would be...

Hoo boy, found https://docs.microsoft.com/en-us/cpp/c-language/parsing-c-command-line-arguments?view=vs-2019, which lays out the quoting rules. Adding the quotes shouldn't be a problem, but escaping the arguments will require some care.

Here's an attempt at implementing the quoting rules: https://github.com/chrisbouchard/alacritty/blob/quote-windows-args/alacritty_terminal/src/tty/windows/mod.rs#L316-L380 I haven't had a chance to actually try this on Windows yet. (I at least know it compiles.) Once I have,...

@chrisduerr Yes, thank you. I believe the function I linked last night does what you describe. I just had a chance to try it out on my Windows laptop, and...

Ok, it's definitely better — I'm able to pass arguments containing whitespace and have them come across as a single argument to the command. But I'm only getting more puzzled...

Oh FFS... It's _PowerShell_ that's "wrong"! https://stackoverflow.com/questions/6714165/powershell-stripping-double-quotes-from-command-line-arguments

Ok, I'll leave this up to you guys. I have a fix that seems to implement the rules described in [Everyone quotes command line arguments the wrong way](https://docs.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way) (the function...

> It does not. You're trying to solve the problem of splitting a Windows commandline into arguments. We'd need to solve the problem of maintaining argument separation when turning an...