Skip to content

REMOVE THIS REQUEST #18626

Closed
Closed
Feature
@basantrauniyar15

Description

@basantrauniyar15

Description of the new feature

Description:
While using CMD, we sometimes enter incorrect commands by mistake. However, CMD does not provide a built-in way to remove or undo the last entered command. This can be frustrating, especially when working with Git, file management, or system commands.
For example, if I mistype a command:
cmd
git sttaus (wrong command)

CMD simply returns an error, and I have to manually retype the correct command:
cmd
git status (correct command)

Similarly, if I accidentally create a file or directory:
cmd
mkdir myfolder

I must manually delete it with:
cmd
rmdir /s /q myfolder

Instead of this, a simple undo command could help users immediately remove or correct their last incorrect command.

Proposed technical implementation details

Proposed Implementation:
Command History Handling
CMD can maintain a temporary history of commands.
If the last command resulted in an error (e.g., "not recognized as an internal or external command"), undo would remove it from history.
Undoing Mistaken Commands
If the last command was invalid, undo would simply clear it from history.
If the last command made an unintended change (e.g., mkdir folder), undo could automatically revert the action (rmdir /s /q folder).
Usage Example:
If a user types a wrong command:
cmd
git sttaus (wrong command)

They can run:

cmd
undo

This will remove the incorrect command, so it does not appear when using the up-arrow key in CMD.

If a user accidentally creates a folder:
c
mkdir testfolder

Running:

cmd
undo

Will delete testfolder automatically.

Integration in CMD
The undo command could be built into CMD as an enhancement to history management.
Optionally, undo --last could revert only the last mistake, while undo --list could show recent commands for selection.
This feature would improve workflow efficiency and reduce frustration when working in CMD.

Would love to hear feedback on this idea!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-AttentionThe core contributors need to come back around and look at this ASAP.Needs-Tag-FixDoesn't match tag requirementsNeeds-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions