nushell: [0.67] [Windows] CMD.exe internal commands no more recognized and throwing errors/breaking scripts
Describe the bug
Hi there!
Since v0.67 and Windows cmd.exe changes and #6253, common Windows CMD commands cannot be run within Nushell anymore.
Although I understand the will to handle errors in a better way, the previous release allowed Windows users to easily merge both shells’ commands within their script which was very handy (read: now with the introduced change all my scripts are broken).
I did not find alternatives to title, echo., nor pause (see below).
IMO, I found cd.. and cls easier to type than cd .. and clear.
Also, the escape prefix ^ does not work.
How to reproduce
- Type one of the following commands in a Nushell under Windows — they return an error;
title "My Window"
echo.
cd..
pause
cls
- Escaping with the prefix
^does not work.
Expected behavior
title "My Window → Changes window title
echo. → Prints a linebreak
cd.. → Navigates to the upper folder
pause → Pauses script execution
cls → Clears the window
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.67.0 |
| branch | |
| commit_hash | 91976988f032276ca48faff2d1ac13c079eda836 |
| build_os | windows-x86_64 |
| build_target | x86_64-pc-windows-msvc |
| rust_version | rustc 1.63.0 (4b91a6ea7 2022-08-08) |
| rust_channel | stable-x86_64-pc-windows-msvc |
| cargo_version | cargo 1.63.0 (fd9c4297c 2022-07-01) |
| pkg_version | 0.67.0 |
| build_time | 2022-08-17 15:20:56 +00:00 |
| build_rust_channel | release |
| features | database, dataframe, default, trash, which, zip |
| installed_plugins |
Additional context
Maybe add more exception in https://github.com/rgwood/nushell/blob/00bace9e82d3f3e3e337c510ce6cef0818ade7aa/crates/nu-command/src/system/run_external.rs#L134
Creating aliases is NOT, imho, the best solution for users who work on multiple workstations and which would require an extra step/third party program to sync config files.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (12 by maintainers)
Added
clsandpausein https://github.com/nushell/nushell/pull/6371.in order to use
title, assuming it works at all these days, you’d have to turn offshell integrationin nushell via config.nu because nushell sets the title with every prompt draw now.This is also I think a good heuristic. If the cmd built-in has a direct equivalent in pwsh, it should have an equivalent (even if not aliased to the same name) in nu.
If it’s not available in pwsh, it’s probably not all that important in practice (otherwise it would’ve been added to pwsh by now).