-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Works so slow when I try to paste long string to terminal #513
Comments
(Related to #240.) Being slow with large inputs is a known issue. There seems to be two main causes:
I've briefly looked at solving the first in zsh, but I haven't had time to make a complete patch. With regards to disabling styles, setting a style to none doesn't disable the code that parses for that style. We could add a flag to disable
and once #512 is merged the highlighting of command and process substitution and their contents. If that's acceptable, you can add |
Thx a lot! I didn't really find a func named It did work a little faster Tip in #86 is a good idea, I think I will just disable highlighting when I have a very large input |
Ah forgot the current release doesn't have that function. Where you added it will do similar, but may mess up the state in some cases. Don't think there's a single line change that'd work in the current release. There's also the possibility to replace some loops with an |
I viewed #86 and some of the source code again, came up with a temporary solution: Add Now it will just stop parse or highlight any long string, and this works well for me. Thanks for your help!! |
@phy1729 Do you recall that Shall we open separate tickets for the two "X is quadratic" issues you identify? |
The issue with Array appends are quadratic are discussed in #388. We could open an issue for string iteration being quadratic. |
I encounter the similar issue when I copy |
I'd recommend just using |
Thanks I lot. I think I will use the former one. |
Thanks for sharing the |
Reference: zsh-users/zsh-syntax-highlighting#513 Without `ZSH_HIGHLIGHT_MAXLENGTH=20` in `~/.zshrc`, pasting multiline blocks of code to the terminal was crazy slow. I set it to 20 characters for no other reason than that's what popped into my head. On branch fix-slow-paste-with-syntax-highlight-enabled - Changes to be committed: - modified: home/.zshrc
There are two separate possible causes to slowness:
If someone observes slowness that doesn't fall into one of these two buckets, please let us know. (And, naturally, help fixing #240 would be welcome, if anyone's interested.) |
this gist works fine. |
Thanks! Does the feature/redrawhook branch have this problem too? If it does, we should look into what bracketed-paste-magic does that makes a difference. |
In my experience, if you paste something into the terminal and it's taking a long time to draw, you can push any button on the keyboard (e.g. right arrow) and it'll give up highlighting and draw the text. |
forresthopkinsa that worked thanks |
Another hack: don't paste heavily indented text. IME pasting resumes at normal speeds on newlines that have no indentation. Worked better than any of the above for me. |
@matthinea Hi, sorry for the delay. Thanks for the lead. Could you please show the output of |
(I stopped using zsh-highlight-version when I thought it was slowing down pasting) |
```
typeset ZSH_VERSION=5.3
typeset ZSH_PATCHLEVEL=zsh-5.3-0-g4cfdbdb
```
(I stopped using zsh-highlight-version when I thought it was slowing down pasting)
Then cat the files `.version` and `.revision-hash` in the same directory as `zsh-syntax-highlighting.zsh`.
|
This comment fixed it for me: #295 (comment) and the issue is probably a duplicate of this one |
when pasting long lines: zsh-users/zsh-syntax-highlighting#513 (comment)
this should be added to the readme file or installation document |
Thanks for asking. It's hard to say, since this issue covers so many bases:
Also, everyone might be using different versions of zsh and this plugin and other plugins. At this point, I'll go ahead and close this issue. Please do not continue discussion on this ticket; open a new ticket for anything that remains. |
I am just using
main
highlighter. At first, I thought if I just disable some styles, it will work fine. So I disabled allquoted-argument
.When I paste
magnet:?xt=..t.nz
after"
into the terminal:aria2c "magnet:?xt=urn:btih:90...er.fastcast.nz"
The highlight is gone, but it's still really slow!
I really love the highlighting, how can I make it faster?
The text was updated successfully, but these errors were encountered: