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

Very slow paste with `zsh-autosuggestions` enabled #1276

Closed
caesar opened this issue Dec 20, 2016 · 13 comments
Closed

Very slow paste with `zsh-autosuggestions` enabled #1276

caesar opened this issue Dec 20, 2016 · 13 comments

Comments

@caesar
Copy link

@caesar caesar commented Dec 20, 2016

With zsh-autosuggestions enabled, pasting is very slow – I see each character appear, one character every few ms. The same applies to opening the config file with Cmd+, – I see each line of the message "typed" and then executed, over a period of about 2 seconds, before the file opens.

Without zsh-autosuggestions I don't notice this, so obviously that software is partly to blame, but Hyper is also a factor here because pasting is instant in iTerm even with zsh-autosuggestions.

I believe this is because Hyper sends each character of a pasted string individually, whereas iTerm must be sending the whole string at once.


Hyper 1.0.0
Electron 1.4.7
darwin x64 15.6.0

@xvalentino

This comment has been minimized.

Copy link

@xvalentino xvalentino commented Jan 30, 2017

Anyone have any ideas of how this can be done?

From poking around it looks like the problem could be here

this.onVTKeystroke(text);

onVTKeystroke may be typing the content in letter by letter

@vvo

This comment has been minimized.

Copy link

@vvo vvo commented Jan 30, 2017

Quick note, on the standard terminal app on osx we have the same issue so I would say any time we use zsh-autosuggestions we are screwed and this is not a specific issue of hyper?

@xvalentino

This comment has been minimized.

Copy link

@xvalentino xvalentino commented Jan 30, 2017

oh, you're very right. I didn't think I ran into this in iTerm, but I also do there.

@xvalentino

This comment has been minimized.

Copy link

@xvalentino xvalentino commented Jan 30, 2017

zsh-users/zsh-autosuggestions#141

Seeing as this is an issue here, we can probably close this.

@balta2ar

This comment has been minimized.

Copy link

@balta2ar balta2ar commented Feb 18, 2017

Fixing delays on zsh-autosuggestions is, of course, necessary to do, but on the other hand, I believe https://github.com/zsh-users/zsh/blob/master/Functions/Zle/bracketed-paste-magic could be of great help here. In fact, I've experienced the same issue with Midnight Commander for a really long time. I described my unsuccessful hacking attempts here: zsh-users/zsh-autosuggestions#136 (comment). Maybe similar technique could be employed here?

EDIT: Just for the reference, mc's issue: https://midnight-commander.org/ticket/2072#comment:21

@sn0wyfall

This comment has been minimized.

Copy link

@sn0wyfall sn0wyfall commented Mar 18, 2018

I'm experiencing this and I'm fairly sure that I don't have zsh-autosuggestions enabled. This does however only occur with zsh – with bash it pastes much faster. I'm unsure how to diagnose my issue. Any pointers would be appreciated!

@timothyis

This comment has been minimized.

Copy link
Member

@timothyis timothyis commented Apr 23, 2018

I'm pretty sure this should be okay with the latest version! Please let us know if it's not fixed.

@timothyis timothyis closed this Apr 23, 2018
@mportela

This comment has been minimized.

Copy link

@mportela mportela commented Aug 7, 2018

echo $ZSH_VERSION
5.3

still very slow when pasting a large string.... :(

@sn0wyfall

This comment has been minimized.

Copy link

@sn0wyfall sn0wyfall commented Aug 13, 2018

Same.

$ echo $ZSH_VERSION
5.3
@fmeng

This comment has been minimized.

Copy link

@fmeng fmeng commented Jan 20, 2019

very slow when pasting a large string
$ echo $ZSH_VERSION
5.3

@hriddhidey

This comment has been minimized.

Copy link

@hriddhidey hriddhidey commented Feb 23, 2019

Same here. Excruciatingly slow while pasting long cURLs in zsh with zsh-autosuggestions enabled.
I really don't know why this issue is closed. It's very much still open.
$ echo $ZSH_VERSION
5.3

@uv-w

This comment has been minimized.

Copy link

@uv-w uv-w commented Apr 16, 2019

mkdir $ZSH_CUSTOM/lib/
cp $ZSH/lib/misc.zsh $ZSH_CUSTOM/lib/.
vi $ZSH_CUSTOM/lib/misc.zsh

I commented the following lines, but you can remove it or change the if condition.

image

from:
https://apple.stackexchange.com/questions/312795/zsh-paste-from-the-clipboard-a-command-takes-a-few-second-to-be-write-in-the-ter

@fredleger

This comment has been minimized.

Copy link

@fredleger fredleger commented Jul 12, 2019

Seems that since some recent version the same workaround than the one suggested by @uv-w can be achieved by setting : DISABLE_MAGIC_FUNCTIONS=true in .zshrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.