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

cmd+k to clear terminal is surprisingly slow #10176

Open
1 task done
marwan-at-work opened this issue Apr 4, 2024 · 16 comments
Open
1 task done

cmd+k to clear terminal is surprisingly slow #10176

marwan-at-work opened this issue Apr 4, 2024 · 16 comments
Labels
bug [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc performance Feedback for performance issues, speed, memory usage, etc terminal Feedback for terminal integration, shell commands, etc

Comments

@marwan-at-work
Copy link

marwan-at-work commented Apr 4, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

To reproduce:

  1. Open the Zed terminal.
  2. Press "enter" a few times to create multi line
  3. Type "cmd+k" to clear the screen.
  4. Note how it takes a few seconds to do it.
  5. Compare with typing "clear" instead of cmd+k to notice the difference in speed.

Environment

Zed: v0.129.2 (Zed)
OS: macOS 14.3.0
Memory: 96 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

zedclear.mov

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@marwan-at-work marwan-at-work added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Apr 4, 2024
@JosephTLyons JosephTLyons added performance Feedback for performance issues, speed, memory usage, etc terminal Feedback for terminal integration, shell commands, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Apr 4, 2024
@showme032
Copy link

Yeah I have the same issue, even though in one post I saw it was apparently fixed. Cmd+K still takes about a second after typing to clear the console.

@notpeter
Copy link
Member

I can no longer reproduce this and I think this was likely fixed.

@marwan-at-work can you confirm this is not longer an issue for you?

@notpeter notpeter added the needs info / awaiting response Issue that needs more information from the user label Jun 15, 2024
@mikayla-maki
Copy link
Contributor

This was an issue with our action dispatch and was fixed a little while ago.

@showme032
Copy link

showme032 commented Jun 15, 2024

I still have it on Zed Preview 0.140.4. Although it seems to have improved, there is still a noticeable delay between command input and action

Screen.Recording.2024-06-15.at.10.03.43.mov

@marwan-at-work
Copy link
Author

Yes there is still a pretty noticeable delay running Zed: v0.139.3

@mikayla-maki
Copy link
Contributor

Ahh, I thought I remembered a fix going out.

@mikayla-maki mikayla-maki reopened this Jun 15, 2024
@GraphtyLove
Copy link

Same issue with Zed 0.139.3. Running on a Macbook Air M2.

@Moshyfawn Moshyfawn removed the needs info / awaiting response Issue that needs more information from the user label Jun 16, 2024
@marwan-at-work
Copy link
Author

If it helps w/ debugging: if you press almost any key after cmd+k, then the screen is cleared quickly without any delay.

@stalkerg
Copy link
Contributor

Okey, it's not only for the terminal! I am using ctrl-k to delete the lines, and I have the same delay and the same behavior (any new input is a clear view).
If I set this binding to any other configuration, it does not happen. Something else is triggered for ctrl/cmd-k.
I built Zed from the source a few moments ago, the latest git.

@GraphtyLove
Copy link

GraphtyLove commented Jul 12, 2024

It looks like a vim binding.
When you press CMD+k it looks like Zed is waiting for another key to be pressed to do something.
Like a macro record or something.

When you press any key after that, the symbol in bottom disappear and the terminal is cleared.

image

@notpeter
Copy link
Member

notpeter commented Jul 13, 2024

I wanted to suggest two potential workarounds until this is fixed:

  1. ctrl-l. This will clear the terminal without delay. Note it serves a different function. cmd-k clears the screen AND the scrollback buffer, while ctrl-l just clear the screen and leaves the scrollback buffer alone.

  2. Custom keybind for double cmd-k. This is what I have in my ~/.config/zed/keybind.json:

[
  {
    "context": "Terminal",
    "bindings": {
      "cmd-k cmd-k": "terminal::Clear"
    }
  },
]

See also:

@stalkerg
Copy link
Contributor

stalkerg commented Oct 4, 2024

for me it's became working fine, is it still an issue for you?

@GraphtyLove
Copy link

for me it's became working fine, is it still an issue for you?

Seems fixed on my side! (Zed 0.155.2)
@marwan-at-work I think you can close the issue if it works on you end too! :)

@marwan-at-work
Copy link
Author

@GraphtyLove hi there, I just tested it and it's still slow for me.

$ zed --version
Zed 0.155.2 – /Applications/Zed.app

Let me know if there's anything to do or to help with on my side. Thanks!

@dangh
Copy link

dangh commented Oct 27, 2024

@marwan-at-work I think you need to add cmd-k key to your keymap to disable the default behavior. This is my keymap:

{
  "context": "Terminal",
  "bindings": {
    "cmd-k": "terminal::Clear"
  }
}

@marwan-at-work
Copy link
Author

@dangh thank you that fixed it! However, it should not be necessary for everyone to create the above keymap config, that should be the default behavior unless I'm missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc performance Feedback for performance issues, speed, memory usage, etc terminal Feedback for terminal integration, shell commands, etc
Projects
None yet
Development

No branches or pull requests

9 participants