elvish icon indicating copy to clipboard operation
elvish copied to clipboard

Prefer `.ps1` than `.cmd` when both file exists in path

Open balthild opened this issue 1 year ago • 3 comments

What new feature should Elvish have?

Currenlty on Windows, when both .ps1 and .cmd exists for a command (e.g. scoop), elvish will prefer invoking the .cmd.

However, cmd scripts are bad on UX. Specifically, It prompts "Terminate batch job (Y/N)" when Ctrl+C pressed. Therefore, it should be avoided if alternatives exists.

image

Output of "elvish -version"

0.21.0+official

Code of Conduct

balthild avatar Nov 05 '24 22:11 balthild

There are a few workarounds to suppress the "Terminate batch job" prompt documented here: https://superuser.com/questions/1705792/how-to-suppress-windows-batch-job-termination-confirmation

xiaq avatar Jan 03 '25 22:01 xiaq

See my comment in #1854 about this feature request; I'm leaning towards rejecting this, but maybe it's a good idea to special-case .elv files on Windows instead.

xiaq avatar Jan 03 '25 22:01 xiaq

There are a few workarounds to suppress the "Terminate batch job" prompt documented here: https://superuser.com/questions/1705792/how-to-suppress-windows-batch-job-termination-confirmation

This only applies when I'm writing the script. However, in most of the times, the .cmd files are provided by package managers, e.g., scoop.

balthild avatar Jan 15 '25 04:01 balthild