waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

Add icon to remove some item/prompt from history

Open CharlesNepote opened this issue 2 years ago • 1 comments

Originally published by @ayoubelmhamdi (https://github.com/wavetermdev/waveterm/issues/72).

This is interesting but it can leads to strange situations -- even dangerous ones. Eg.

MY_PATH="/my/deep/path"
several_other_commands_here
MY_PATH="/" # delete this prompt, and forget it after coffee break...
sudo rm -r "${PATH}"/*

That's why I prefer to keep the removed items into an archive. Have you tried the "Archived" function? You have to click on the gearwheel (which is not very handy though). image

Wouldn't it be better to enhance the "archive" function? Eg.

  • it would be possible to archive a command box with a click on an icon (like the "bookmark" one)
  • archived elements could be turned into light grey but not removed

CharlesNepote avatar Dec 16 '23 10:12 CharlesNepote

The "archive" functionality is a bit confusing since it does actually remove the line from view (so on the screen at least it looks similar to a delete).

So, in this PR, I've added a hot key Cmd-D to remove the currently selected command block, and a trash icon to also remove a command block.

I'm also removing the "archive" switch in the line settings and will likely deprecate the "archive line" functionality completely.

In the future to address the weird situation that you mentioned above, I'm thinking is to enhance the "minimize" functionality (so it is stored in the DB and persists properly). Can also try to tighten up the UI for a minimized line so it takes even less space. That will be the replacement for archive.

Note that (in a separate PR) in this release I'm also updating how "delete" and "archive" work for lines. Delete will now delete the line from the tab (and all of the stored output), but the history entry will be retained. I think that's more intuitive. So if you hit Ctrl-R to see the latest commands, you'll still see the "deleted" command in the history even though it is gone from the UI.

sawka avatar Jan 07 '24 08:01 sawka