Closed Timoses closed 3 years ago
It seems like /tmp/d*
does not exist:
% ls /tmp/d*
zsh: no matches found: /tmp/d*
Above works when pane is zoomed in (fills space of screen). However, once the pane is smaller I get this:
I'm not sure what you mean by this. Can you please include clear, step-by-step instructions to reproduce?
@Timoses Is this by any chance a duplicate of #291?
Possibly. It's at least the same symptom.
I'm not sure what you mean by this. Can you please include clear, step-by-step instructions to reproduce?
I am able to reproduce it on my Mac, however not with the same command (ls /tmp/d
).
Step by step:
% tput cols && tput lines
179
56
tput
)
% tput
terminal capabilities
OTMT OTNL OTbs OTnc OTns OTpt OTxr acsc am bce bel blink bold bw cbt ccc chts civis clear cnorm colors cols cpix cr crxm csr
cub cub1 cud cud1 cuf cuf1 cup cuu cuu1 cvvis da daisy db dch dch1 dim dl dl1 ech ed el el1 eo eslok flash gn
hc hls home hpa hs ht hts hz ich il il1 in ind indn init initc invis is2 it kDC kEND kHOM kIC kLFT kNXT kPRV
kRIT ka1 ka3 kb2 kbs kc1 kc3 kcbt kcub1 kcud1 kcuf1 kcuu1 kdch1 kend kent kf1 kf10 kf11 kf12 kf13 kf14 kf15 kf16 kf17 kf18 kf19
kf2 kf20 kf21 kf22 kf23 kf24 kf25 kf26 kf27 kf28 kf29 kf3 kf30 kf31 kf32 kf33 kf34 kf35 kf36 kf37 kf38 kf39 kf4 kf40 kf41 kf42
kf43 kf44 kf45 kf46 kf47 kf48 kf49 kf5 kf50 kf51 kf52 kf53 kf54 kf55 kf56 kf57 kf58 kf59 kf6 kf60 kf61 kf62 kf63 kf7 kf8 kf9
khome kich1 kind km kmous knp kpp kri lines longname lpix mc0 mc4 mc5 mc5i meml memu mgc mir msgr ndscr npc nrrmc nxon oc op
os pairs rc rep reset rev ri rin ritm rmacs rmam rmcup rmir rmkx rmm rmso rmul rs1 rs2 sam sc setab setaf sgr sgr0 sitm
smacs smam smcup smglr smir smkx smm smso smul tbc u6 u7 u8 u9 ul vpa xenl xhp xhpa xon xsb xt xvpa
% tput cols && tput lines
20
5
% tput
zsh: do you wish to see all 4 possibilities (5 lines)?
What I found I can do even is the following:
Screenshots for above:
Above (for MacOS) I can reproduce with both native MacOS terminal.app
application and alacritty
terminal.
Ah, now I get it. That's expected behavior and a "feature" of zsh
. There's not really anything I can do about that. You might want to file a bug report about this on the zsh
mailing lists.
Thanks. Was able to fix it with
zstyle ':completion:*' list-prompt ''
(https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Standard-Styles)
Hm, though it doesn't really fix it as it's still 'eating' key strokes...
@Timoses But it happens only when you resize and your currently have a list of completions open, right? That case is pretty much beyond my control.
No, it also happens when the window is already small. I was hoping for something like a style that says 'Only show max X lines of completions suggestions and never show "do you want to see..."'. Didn't find anything that could help. I agree, it's on zsh side.
No, it also happens when the window is already small.
How small?
Just made a 'border' test to see how small I have to shrink it so that it asks me if I want to see all (instead of just showing).
On Macos with the tput
this still works:
21:42:35 130 libellem.local> tput lines && tput cols
22
77
while this shows the question whether I want to see it all (practically disturbing my typing):
21:44:09 130 libellem.local> tput lines && tput cols
22
76
Keeping the same columns and increasing the height of the window it again works (shows all completions) when the window is this large:
21:45:06 130 libellem.local> tput lines && tput cols
24
76
This is how the last scenario looks when it just barely shows:
while this shows the question whether I want to see it all (practically disturbing my typing):
21:44:09 130 libellem.local> tput lines && tput cols 22 76
I'm unable to reproduce it when typing in a Terminal of that size on macOS. Can you give me some examples of what you're typing when you get interrupted?
Oh, and have you updated zsh-autocomplete
to the latest commit on the main
branch?
> antibody update
marlonrichert/zsh-autocomplete a7f69c9 -> 20b332c
Well, as stated above I am typing the following: tput
(<- with a space at the end).
Which by default produces this output
% tput
terminal capabilities
OTMT OTNL OTbs OTnc OTns OTpt OTxr acsc am bce
bel blink bold bw cbt ccc chts civis clear cnorm
colors cols cpix cr crxm csr cub cub1 cud cud1
cuf cuf1 cup cuu cuu1 cvvis da daisy db dch
dch1 dim dl dl1 ed el el1 enacs eo eslok
flash gn hc hls home hpa hs ht hts hz
ich il il1 in ind indn init is2 it kbs
kcbt kcub1 kcud1 kcuf1 kcuu1 kdch1 kend kf1 kf10 kf11
kf12 kf2 kf3 kf4 kf5 kf6 kf7 kf8 kf9 khome
kich1 km kmous knp kpp lines longname lpix mc5i mir
msgr ndscr nel npc nrrmc nxon op os pairs rc
reset rev ri rin rmacs rmcup rmir rmkx rmso rmul
rs2 sam sc setab setaf sgr sgr0 smacs smcup smir
smkx smso smul tbc ul vpa xenl xhp xhpa xon
xsb xt xvpa
If I make the window smaller it shows:
% tput
%
% tput
zsh: do you wish to see all 116 possibilities (15 lines)?
I now also found a scenario where it shows this:
% tput
terminal capabilities
OTMT OTNL OTbs OTnc OTns OTpt OTxr am bce
bel blink bold bw cbt ccc chts civis clear
cnorm colors cols cpix cr crxm csr cub cub1
cud cud1 cuf cuf1 cup cuu cuu1 cvvis da
daisy db dch dch1 dim dl dl1 ed el
eo eslok flash gn hc hls home hpa hs
hz ich il il1 in indn init is2 it
kbs kcub1 kcud1 kcuf1 kcuu1 kdch1 kf1 kf10 kf2
kf3 kf4 kf5 kf6 kf7 kf8 kf9 khome kich1
km knp kpp lines longname lpix mc5i mir msgr
ndscr nel npc nrrmc nxon os pairs rc reset
rev rin rmacs rmcup rmir rmkx rmso rmul rs2
sam sgr0 smacs smcup smir smkx smso smul tbc
ul xenl xhp xhpa xon xsb xt xvpa
(MORE)
(terminal screen is between the small size when it triggers "do you wish to see all ..." and the large size when it has no difficulties showing all). This would be idea for even smaller cases that it would simply show "MORE" and not ask whether one wants to see it all.
So for reproduction it's probably best to first check on a large screen whether tput
also displays lots of answers for you. If so, reduce terminal size to a very small window.
You can see it in live action here: https://asciinema.org/a/P7kHOrAKM5lhLtA5b9tMLnjNo
(Unfortunately you can't see screen resizes there, but I always put tput lines && tput cols
after a terminal size change).
If I make the window smaller it shows:
Yes, that was my point. It only shows under the following conditions, right?
zsh-autocomplete
).do you wish to see
message, which eats up a key stroke.Is that what you mean? If so, then no, there's nothing I can do about that, as the resizing does not trigger zsh-autocomplete
and is handled by zsh
internally. This behavior also happens without zsh-autocomplete
.
But the following never happens, right?
zsh-autocomplete
enabled.do you wish to see
message, eating up a random key stroke.That should never happen (except for a couple of cases that trigger bugs in zsh
's completion code).
This would be idea for even smaller cases that it would simply show "MORE" and not ask whether one wants to see it all.
zsh-autocomplete
attempts to always show (MORE)
and nothing else, when the completion list doesn't fit on screen. However, as I pointed out above, when you resize your terminal window with a completion list open, zsh
does not send any events about this to zsh-autocomplete
(and thus it doesn't get any chance to redraw the screen), but instead handles it internally.
But the following never happens, right?
1. Type something with `zsh-autocomplete` enabled. 2. Suddenly get the `do you wish to see` message, eating up a random key stroke.
That should never happen (except for a couple of cases that trigger bugs in
zsh
's completion code).
It does. As explained above, when the terminal is small enough that the completion menu entries do not fit then it displays 'do you wish ...'.
It happens either by resizing while the completion menu shows or by already having a small terminal size and then typing tput
which should show completion menu but it shows '*do you wish to ...'.
Watch it here: https://vimeo.com/583025620
Thanks for the video. I will add a minimum required terminal size to the Readme, as there really isnβt much I can do for that case. π
I admit the terminal from above window is very small : D.
This would be a more practical example where it's really annoying and where the size isn't really that small: https://vimeo.com/583029610
Plus, it seem's there are some weird effects where first it works with 'MORE' but then again not. And it prints 'do you wish ...' when typing only t
at a quite large size as well.
EDIT: I'll reupload the video, seems to be wrong..
Fixed link: https://vimeo.com/583029610 (above was broken)
From above recording I can reproduce the follwing:
t
t
t
I can even increase a bit more and it still displays 'do you wish...'. Only if I increase it again until I see 'MORE' again, and then reduce size again it displays 'MORE'.
Sounds like a hysteresis curve >.<
Thanks for the new video. I have been able to reproduce some of it now. It looks like I made an optimistic rounding error. I'll have a fix ready soon.
Should be fixed now. At least, I'm not able to reproduce it anymore. π
PS: If you enjoy using my software, please consider sponsoring me.
zsh-autocomplete
version: 3abe9dba037b681ab54131a1219a733f4abb9761Operating system: Linux (Fedora 33)
Above works when pane is zoomed in (fills space of screen). However, once the pane is smaller I get this:
Size info when it works:
Size info when it fials: