On Mon Jan 26 09:11:54 2026 +0000, Yeshun Ye wrote:
Your solution doesn't seem very feasible. This is because Windows supports input in this format: `"pushd path with space"`. If a directory named `"path with space"` exists in the current directory, this command will execute successfully and navigate into `"path with space"`. During the argument parsing stage, we cannot treat this as a single parameter because it is not wrapped in quotes. `pushd` currently works well, and I don't think making extensive modifications is a good idea. I lean more towards patching its minor flaws. As mentioned earlier, Windows's handling is very complex when dealing with combinations of quotes, `/`, and spaces. Without fully grasping the underlying rules, we should not attempt to perfectly solve the problem all at once and expect to achieve behavior identical to Windows. I don't like the idea of idea a specific arg parsing code for every command (but yes, PUSHD and DIR don't have the same)
moreover adding small fixes without grasping the underlying logic generates spaghetti code, that we're trying to remove from cmd.exe perhaps the simplest way forward would be to fail if first char is a '/', then remove enclosing quotes if any, and use the result as directory argument -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9881#note_127991