Warp icon indicating copy to clipboard operation
Warp copied to clipboard

History deletion management

Open elviskahoro opened this issue 3 years ago • 9 comments

Describe the solution you'd like?

I'm thinking a history dialog or workflow for managing history

"The one thing I’m missing so far is a way to delete all or part of the history. Sometimes you by mistake type in things you don’t want to sit there in the history list.

Thanks for all the work you put into Warp, and looking forward to the official release."

Is your feature request related to a problem? Please describe.

No response

Additional context

No response

elviskahoro avatar Dec 09 '21 19:12 elviskahoro

Linking:

  • #194

elviskahoro avatar Dec 09 '21 19:12 elviskahoro

It would be incredibly useful and handy to be able to delete a command from the history via the history popup Of course, this should be agnostic to the shell (bash, zsh or whatever) For instance, in this popup, say I don't want lsof -iTCP:9000 in my history because say 9000 is never going to be something i will check and I entered that by mistake .... It would be great if I can hit delete (or shift-delete or whatever) and have that command removed from history.

elviskahoro avatar Jan 20 '22 18:01 elviskahoro

I have the same issue/requirement. I can't/don't know how to clear the history. I cleared it on ZSH with history -c and even did CTRL+L but it doesn't delete from the fuzzy search. When I press ⬆️ or do a reverse search (CTRL+R) it still shows the last commands.

ricardogaspar2 avatar Jul 21 '22 15:07 ricardogaspar2

Bumping this, also having the same issue. I now have a sensitive password sticking around in my history (plaintext) from a previous command I was running. The ability to remove suggestions would be appreciated.

pecasdev avatar Jul 28 '22 14:07 pecasdev

CC'ing @zheng she's our expert. @pecasdev can you try these steps:

  1. Edit your shell’s history file to delete the password
  2. Press Cmd-K to clear all Blocks from session restoration
  3. Restart Warp

elviskahoro avatar Aug 02 '22 18:08 elviskahoro

Can confirm that wiping zsh_history and restarting Warp did remove the password, thanks!

pecasdev avatar Aug 02 '22 18:08 pecasdev

Hey all, I'm asking for a preference setting to clear history on Command-K.

My use case is simple: I exposed an API key on stream today because I thought my history was cleared with Command-K, and the extra steps needed to clear it out are non-viable in a demanding environment like being on stream.

Related Tweet: https://twitter.com/luke_pighetti/status/1567585061523824642?s=20&t=wocSd2U4LcpY18hF7_fhDw

lukepighetti avatar Sep 07 '22 19:09 lukepighetti

Hey @lukepighetti - thanks for your feedback. I opened another ticket #1812 to address your concern specifically since this one is focused on another problem

zheng avatar Sep 07 '22 19:09 zheng

I'd also like to periodically clear my command history. Like all of it. Full sail. This feels like something I should be able to do in settings easily.

burkeshartsis avatar Sep 20 '22 14:09 burkeshartsis

This command clears your zsh history rm -f ~/.zsh_history && kill -9 $$

jonathanredford avatar Oct 07 '22 09:10 jonathanredford

might be a useful command palette entry?

Screen Shot 2022-10-07 at 10 03 55 AM

lukepighetti avatar Oct 07 '22 14:10 lukepighetti

This feature, a way to quickly delete a command from history, would be greatly appreciated.

I frequently use the Command Search (CTRL+R) to type in abbreviations for verbose commands i use often, and let the terminal fill in the rest - like dodo for docker compose down. Sometimes I might be a bit too quick on the trigger, and forget to press CTRL+R before typing the abbreviation, which results in an invalid command being called and stored in history. From that point on, I can't continue to use the same abbreviation because the abbreviation itself is stored in history and the terminal no longer expands it to be what I want.

Some way of undoing the previous command from history would be golden for this.

amundsno avatar Jan 26 '23 13:01 amundsno

Thanks @amundsno I'll bring this up with the team and see if it's something that can be worked on given the demand.

dannyneira avatar Jan 27 '23 16:01 dannyneira

I also wold like an easy way to remove a given entry from the history. Example: Whenever I search the history for "build" I get an old, wrong suggestion and have to manually look for the right one.

elchead avatar Jun 28 '23 08:06 elchead

This would be especially helpful if you've changed some directory names, so Warp stops suggesting folder names that no longer exist.

olive20xx avatar Jul 01 '23 11:07 olive20xx

I have some intermittent problems with history. For example, connection to one of my machines by ssh is kinda flaky:

  1. after ssh I often found myself stuck (connection happens, I'm in a remote terminal, but I can't type there, it's frozen; reconnection usually helps)
  2. what, in my control freak opinion, is much worse, is that I left with the remote machine login message in my Warp history (The programs included with the Debian GNU/Linux system are free software...)
  3. this login message IS NOT in my local .zsh_history (and yes, echo $SHELL in Warp points to zsh)
  4. restarting Warp do not remove this message from the Warp history

This is irritating. Btw, this is not only example when I don't understand the logic behind the Warp history, especially when few tabs are used, but the only one I could remember right now.

I guess I'm gonna try to delete zsh_history anyway, restart Warp, restore zsh_history, restart Warp again.

skaurus avatar Aug 20 '23 18:08 skaurus

I guess I'm gonna try to delete zsh_history anyway, restart Warp, restore zsh_history, restart Warp again.

mv ~/.zsh_history ~/.zsh_history.bak (done from the Warp itself) quit Warp start Warp

And now I have only one tab instead of four... and this tab is completely empty, no scrollback. Fortunately, I will be able to easily restore my tabs and their function, but wtf.

edit: quit Warp, restored zsh_history from Terminal, started Warp - history is there, but still one tab without scrollback. but at least the login message is gone from the history.

skaurus avatar Aug 20 '23 18:08 skaurus

Actually, this fake history entity reappeared after 2-3 days. I hate it so much. I'm going to turn off Warp QoL features until I find the feature that does that. Nothing, for me, would be useful enough to justify this nuisance.

skaurus avatar Sep 16 '23 17:09 skaurus

I guess I'm gonna try to delete zsh_history anyway, restart Warp, restore zsh_history, restart Warp again.

mv ~/.zsh_history ~/.zsh_history.bak (done from the Warp itself) quit Warp start Warp

And now I have only one tab instead of four... and this tab is completely empty, no scrollback. Fortunately, I will be able to easily restore my tabs and their function, but wtf.

edit: quit Warp, restored zsh_history from Terminal, started Warp - history is there, but still one tab without scrollback. but at least the login message is gone from the history.

thanks it works @skaurus

ahmadrio avatar Oct 22 '23 14:10 ahmadrio

What I found is that commands are stored not only in .zsh_history but also in Warp's database. Here's a workaround to delete the command history:

sqlite3 "/Users/$USER/Library/Application Support/dev.warp.Warp-Stable/warp.sqlite"

In sqlite shell:

delete from commands;
.exit

.zsh_history must also be cleared:

echo "" > ~/.zsh_history

This way the command history no longer exists in the history and in the popup window (up arrow).

alsolonets avatar Dec 24 '23 07:12 alsolonets

command + k? image

JohnYu588 avatar Jan 05 '24 09:01 JohnYu588

command K does nothing for me, I tried to clear the command history and no shortcut works

MrWick7796 avatar Jan 17 '24 06:01 MrWick7796

What I found is that commands are stored not only in .zsh_history but also in Warp's database. Here's a workaround to delete the command history:

sqlite3 "/Users/$USER/Library/Application Support/dev.warp.Warp-Stable/warp.sqlite"

In sqlite shell:

delete from commands;
.exit

.zsh_history must also be cleared:

echo "" > ~/.zsh_history

This way the command history no longer exists in the history and in the popup window (up arrow).

Thanks, this seemed to work.

It's a bit concerning if we have to edit the database e.g. via sqlite3 to remove history. I accidentally pasted my computer password into Warp for example.

Is there really no simpler way to clear history completely? "Clear Blocks" did not appear to help.

7k50 avatar Feb 02 '24 15:02 7k50

The ability to exclude certain commands from history would also be super helpful. For example, I can't tell you how many autocomplete suggestions I get for git commit -m" — all of which are useless. If there was a way to define a command ignore list or something I could add git commit and whatever other commands in my workflow that might occasionally get used with a password. Bonus points if you enable me to periodically wipe the history of certain commands on a recurring basis after some period of time. This would give me all the power of auto complete in the short term without the long term annoyance after say 24hrs or 1 week or something.

burkeshartsis avatar Feb 02 '24 15:02 burkeshartsis

Some way of undoing the previous command from history would be golden for this.

This would be great to have. Currently, when I really want to remove a command from history (mistakenly executed), I use the tip from the comment about sqlite3. I basically do this:

  • find and delete the command from the .zsh_history file
  • use sqlite3 to output all rows from the commands table to a file. Open the file to find the ID of the row that contains the command I want to remove
  • use sqlite3 to remove those rows
  • quit Warp

tcchau avatar Feb 11 '24 12:02 tcchau