hstr icon indicating copy to clipboard operation
hstr copied to clipboard

Delete history without printing whole history by `history -r`

Open foray1010 opened this issue 5 years ago • 8 comments

Is it possible to config hstr to not print out whole history by history -r after deleting history? I found it quite annoying because it shows little information (it is a super long list) and it flushed out all my scrollback which may be useful in some situtation

foray1010 avatar Apr 25 '19 13:04 foray1010

Did you find a way to do this?

@dvorka, after deleting an entry and doing "ctrl+c", history -r runs, printing the whole history. Any way to avoid that?

qazip avatar Jul 07 '19 08:07 qazip

Perhaps I can make it configurable. The purpose of history -r is to get history items from shell sessions in other terminals to the current one. I agree that it might be subjective and some users don't need it. WDYT?

dvorka avatar Sep 17 '19 06:09 dvorka

@dvorka how about history -r > /dev/null? seems can keep the functionality and do not flush the screen

foray1010 avatar Sep 17 '19 10:09 foray1010

I also suspected another weird behavior that is related to history deletion. When an item from history is deleted (and deletion is confirmed with 'y') then selecting another item from history appends string history -r to it. So for example when (after deletion) I select by TAB line git log it actually constructs on command line string git loghistory -r.

pkral78 avatar Jan 06 '20 12:01 pkral78

Note, that it behave same for 2.0.0 (tested on Ubuntu) and 2.2.0 (tested in NixOS). And by the way: this is most useful utility I've found ever. Magic :-)

pkral78 avatar Jan 06 '20 12:01 pkral78

@pkral78 Oh, your are right - it's reproducible! I created https://github.com/dvorka/hstr/issues/386. Thank you for the report!

And by the way: this is most useful utility I've found ever. Magic :-) My pleasure!

dvorka avatar Jan 09 '20 22:01 dvorka

@dvorka #386 is actually not fixed, see https://github.com/dvorka/hstr/issues/386#issuecomment-1103557204

selurvedu avatar Jul 22 '22 11:07 selurvedu

Bump. I made #457 to fix this.

selurvedu avatar Sep 09 '22 22:09 selurvedu