Comments (5)
I don't fully understand your question; to make clear, are you saying:
- At some point in the past, you ran
vi dir_colors
- Then you press
^r
and entervi
- This shows something like this:
$ vi dir_colors
→ in /home/you
→ on 2020-07-22 10:39:15
histdb 0 h: vi
in which the word vi
after the $ is underlined.
4. You press return
5. You see something like this
$ vi dir_colors dir_colors
- If you press return, the shell invokes
vi dir_colors dir_colors
(presumably you can ask vi what its arguments were somehow; I am not a vi user so dunno).
To make clear the expected behaviour:
- You press
^r
- The isearch starts, initialized with whatever you have already in the buffer (the input you are typing)
- Before the buffer and after the prompt is displayed the match; most recent matching history entry will be shown, and the matching region underlined
- Press return
- The match information goes away; the buffer content is replaced with the match from history; the cursor moves to the end of where the underline was.
If this is what's happening, it's not a bug. If at point 5 the buffer doesn't contain the match, something has gone wrong somewhere. In histdb-interactive.zsh
on L160 you will see where I set the buffer after doing the history search. If your buffer ends up containing something other than the history text, I think something else in your zsh config is modifying BUFFER
after _histdb-isearch
has completed. You could check this by doing something like echo "HELLO BUFFER IS ${BUFFER}"
after that line to see what's happening.
Or you can do functions -t _histdb-isearch
to get a trace of what happens when you press ^r
. That will show you what it is setting BUFFER
to when it finishes (and also fill your screen with junk).
I'm afraid I am not going to debug this further for you, but if you can work out what is happening and find that it's something I need to fix I will be happy to fix it.
from zsh-histdb.
I've got a very short screen recording to show what I mean.
I actually start before typing anything with ^r, and then vi to find all vi commands. And then cycle back by continuously hitting ^r.
I'll try out what you suggest, but wanted to show you what I meant, hopefully more clearly.
Screen Recording 2020-07-22 at 8.23.17 AM.mov.gz
from zsh-histdb.
I think what's happening here might just be some redraw crud caused by your fancy prompt or terminal or other feature.
In your video, I notice that after you exit vi (which triggers a screen redraw) the prompt contents for the last command you ran are displayed as I would expect, without json
on the end. One thing this could be is if something in your zsh is setting the value of POSTDISPLAY
, as that variable is dumped after BUFFER
but is just presentation rather than input.
You could check this by amending _histdb-isearch
definition to do something like POSTDISPLAY=""
before the zle recursive-edit
call.
from zsh-histdb.
Thank you, I started digging in yesterday after my video trying to figure out where that was coming from. I appreciate the assistance!
from zsh-histdb.
Bingo! Its POSTDISPLAY holding that, now just to figure out why, I could just clear it out I guess, but like to know why. Thank you very much for your insight!
from zsh-histdb.
Related Issues (20)
- create index on history(place_id, command_id) HOT 2
- search history based on hour:minute
- Example query doesn't seem to do what it purports to HOT 2
- "which sysopen" doesn't work on zsh 5.7.1 and now zsh-histdb won't load HOT 3
- Thank you! HOT 1
- Missing commands in db after restart HOT 1
- [MacOS] zsh: histdb-update-outcome: function definition file not found HOT 1
- Can a four year old installation be upgraded safely? HOT 2
- Does this work on shared file systems? HOT 1
- Per-window history on up-arrow? HOT 2
- Unwanted output when source ~/.zshrc HOT 1
- up-line-or-beginning-search and down-line-or-beginning-search support
- histdb-sync results in error: cannot rebase: You have unstaged changes. HOT 2
- The mode indicator line is not shown before pressing any F key
- Add support for "tags" HOT 1
- Occur "_histdb_query_batch:7: 27: bad file descriptor" problem
- Having a .sqliterc file interferse with zsh-histdb HOT 1
- antidote installation HOT 1
- Pure zsh history import function HOT 1
- launching midnight comader (mc) floods history with garbage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zsh-histdb.