Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #348, fix #386 #457

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix #348, fix #386 #457

wants to merge 1 commit into from

Conversation

selurvedu
Copy link

@selurvedu selurvedu commented Jul 23, 2022

Steps to reproduce the bug:

  1. In hstr, delete an entry.
  2. Select another entry and press Enter
  3. Get history -r appended to the chosen command.
    OR
  4. Select another entry and press Left
  5. Get history -r prepended before the chosen command.

This is reproducible on current master.

I have no idea how this history -r was intended to work in the first place, nor do I know how to prevent history -r from appearing on screen. At least it produces no output, and that's good enough for my workflow.

@vaygr
Copy link

vaygr commented Aug 7, 2023

@dvorka is there a chance this can be shipped in the next release?

@dvorka
Copy link
Owner

dvorka commented Aug 10, 2023

@vaygr Sure, I will retest this PR and might do a patch release. Originally I was not able to repro the bug, I will try to do that once more.

@dvorka
Copy link
Owner

dvorka commented Aug 10, 2023

@vaygr I tested the scenarios on hstr 3.0.1 and it works for me (I'm not able to repro the 🐞). Perhaps 7d984e4 fixed it for me, but not for @selurvedu (based on the discussion in #386).

Anyway, I will build hstr from this PR branch and try to use it on my machines.

Can you please share which shell (bash or zsh), OS and hstr version you use? Thanks!

@vaygr
Copy link

vaygr commented Aug 10, 2023

@dvorka this was tested on Manjaro with 3.1.0. bash 5.1.16(1)-release.

@dvorka
Copy link
Owner

dvorka commented Aug 10, 2023

@vaygr thanks!

@vaygr
Copy link

vaygr commented Aug 10, 2023

This by the way is reproducible not only with Enter, but with Tab as well.

This is what I get when trying to remove a random entry and select tig:

$  hh --
tig
history -r
$ tighistory -r
bash: tighistory: command not found

Relevant hstr config:

# hstr
export HH_CONFIG=keywords
export HH_PROMPT="// "
shopt -s histappend              # append new history items to .bash_history
export HISTCONTROL=ignorespace   # leading space hides commands from history
export HISTFILESIZE=10000        # increase history file size (default is 500)
export HISTSIZE=${HISTFILESIZE}  # increase history size (default is 500)
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"   # mem/file sync
# if this is interactive shell, then bind hh to Ctrl-r (for Vi mode check doc)
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hh -- \C-j"'; fi

@selurvedu
Copy link
Author

selurvedu commented Nov 13, 2023

Rebased to fix the conflict introduced in 451758c#diff-258da76bc59b38c71c18642eba6ab2c8d4d8e63636d069002ff59e3d7f7f1b2cL408-R408.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants