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

[bug]: Slow pasting with fast-syntax-highlighting installed #68

Open
segevfiner opened this issue Jul 1, 2024 · 5 comments
Open

[bug]: Slow pasting with fast-syntax-highlighting installed #68

segevfiner opened this issue Jul 1, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@segevfiner
Copy link

Describe the bug

With fast-syntax-highlighting installed, pasting long multiline commands takes a long time, with it getting typed character by character very slowly. For example, a command from the "Copy as cURL" option the Chrome DevTools Network tab.

Steps to reproduce

  1. Paste a long command into a terminal with fast-syntax-highlighting installed. (Using the OS clipboard)

e.g.

Command:
curl -v -X POST https://httpbin.org/anything \
  -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
  -H 'accept-language: en-US,en;q=0.9,he;q=0.8' \
  -H 'cache-control: max-age=0' \
  -H 'if-modified-since: Sun, 30 Jun 2024 02:04:22 GMT' \
  -H 'priority: u=0, i' \
  -H 'referer: https://www.google.com/' \
  -H 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: document' \
  -H 'sec-fetch-mode: navigate' \
  -H 'sec-fetch-site: cross-site' \
  -H 'sec-fetch-user: ?1' \
  -H 'upgrade-insecure-requests: 1' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' \
  -H "Content-Type: application/json" \
  -d '{"Hello": "World", "data": "
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sit amet porttitor mauris. Ut pulvinar, massa non pellentesque tincidunt, nunc dolor vestibulum diam, ac cursus dui mauris sed massa. Sed sagittis luctus metus id mollis. In ultricies erat ligula. Vivamus neque sem, porttitor et tellus nec, dictum dignissim leo. Sed vulputate purus vel purus ornare suscipit. Phasellus sagittis lobortis purus, non tempor orci semper ut. Cras ac scelerisque libero, at posuere enim. Praesent sed ante hendrerit, dapibus purus in, auctor lorem. Cras pharetra vel lectus eu bibendum. Mauris fermentum orci ex, ac egestas nisi tincidunt id. Maecenas ut enim blandit, tincidunt felis vitae, sagittis quam. Duis dapibus nec lacus vel dapibus.

Nulla molestie ullamcorper nibh, at rhoncus elit condimentum sed. Pellentesque vel libero ut libero euismod porta non finibus turpis. Aenean risus mauris, vulputate eu enim vel, facilisis interdum libero. Vivamus vestibulum nulla eu lobortis gravida. Aliquam in posuere magna. Sed iaculis venenatis tincidunt. Nulla sapien quam, aliquam id finibus vel, hendrerit vitae odio. Donec convallis gravida nibh, quis venenatis erat finibus in. Donec ullamcorper interdum enim, at placerat felis viverra eget. Maecenas venenatis, lorem nec ultrices tempor, nisi dolor posuere arcu, eu facilisis turpis turpis vitae magna. Aliquam ut pulvinar tortor. Phasellus nisi augue, dignissim in justo sed, mattis pharetra mauris. Vestibulum porttitor molestie nunc vitae placerat. Ut imperdiet orci eget mauris rhoncus, eu posuere purus aliquam. Vestibulum nisl quam, ultrices at justo eu, condimentum luctus sem. Aliquam fermentum ut tellus at blandit.

Sed vulputate molestie metus, sit amet suscipit massa viverra at. Integer euismod lorem a neque fermentum luctus. Donec quis gravida nulla. Cras rhoncus purus in arcu laoreet, in sodales lectus blandit. Ut ac massa id ex eleifend commodo id vitae arcu. Vivamus gravida bibendum pulvinar. Aenean ullamcorper dui congue ipsum cursus consectetur. Praesent eget metus quis felis pharetra tincidunt vitae vitae tortor. Aenean risus nibh, dignissim a lacus sed, commodo varius quam. Sed velit magna, tincidunt sed semper nec, tristique vitae dolor. Mauris porta ligula eu risus congue suscipit. Aenean aliquet augue nec orci posuere, eget tristique magna volutpat. Praesent enim turpis, sagittis quis sapien et, efficitur efficitur arcu. Praesent a eleifend mauris, vel pretium neque.

Cras luctus nulla tincidunt molestie pretium. Integer ac lacus sit amet odio aliquet iaculis sit amet ac quam. Proin dignissim quis neque ut maximus. Maecenas gravida lacinia lacinia. Phasellus malesuada vitae ipsum vitae dignissim. Cras ipsum tellus, malesuada vel euismod id, vulputate sed tortor. Nam varius enim eu ullamcorper ullamcorper.

Maecenas eu dignissim tellus, nec mattis est. Duis condimentum risus sit amet felis fermentum laoreet. Duis mollis metus et auctor eleifend. Duis mauris odio, malesuada at lacinia id, iaculis et lacus. Duis tincidunt ipsum vitae lorem fringilla pretium. Nam mollis consequat lacus sit amet pulvinar. Nulla fermentum quam nec ex efficitur, a eleifend nisi malesuada. Phasellus porta odio eget est aliquet dictum. Ut dignissim ac lectus nec blandit. Maecenas pulvinar, ex quis interdum egestas, nisl arcu laoreet massa, a molestie nulla tortor in ligula. Nullam tempor gravida nisi, non tempus elit convallis vel. Integer auctor, ipsum eget dapibus laoreet, sem libero iaculis lacus, elementum efficitur ante nunc porta velit. Mauris vehicula, urna eu fringilla pulvinar, purus magna fermentum orci, ac pretium nisi felis vitae massa."}'

Expected behavior

It runs fast.

Screenshots and recordings

recording.webm

Operating System & Version

darwin23.0 | apple | x86_64 | arm64 | arm64 arm

Zsh version

zsh 5.9 (x86_64-apple-darwin23.0)

Terminal emulator

iTerm2 v3.5.2 TERM=xterm-256color

If using WSL on Windows, which version of WSL

None

Additional context

No response

@segevfiner segevfiner added the bug Something isn't working label Jul 1, 2024
@svenjacobs
Copy link

Do you also have zsh-autosuggestions installed? Maybe the issue is related to it?

@segevfiner
Copy link
Author

I do. But when I only disabled fast-syntax-highlighting, it was fast enough...

@segevfiner
Copy link
Author

Oh. But if I disable autosuggestions, it does hang the terminal for a bit, but doesn't do the character by character type thingy.

@svenjacobs
Copy link

See if the fix I linked above helps?

@segevfiner
Copy link
Author

segevfiner commented Jul 2, 2024

And the workaround/fix described there works. Which likely also effects the slight slowness added by fast-syntax-highlighting which is compounded by autosuggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants