zed icon indicating copy to clipboard operation
zed copied to clipboard

Rapidly hitting the space key twice does not add a period "." in text areas that aren't actual code buffers

Open fredrikekelund opened this issue 8 months ago • 4 comments

Summary

In text fields on macOS, tapping the space key twice in quick succession normally inserts a period ("."). This is not the case in the agent panel text area in Zed. The same goes for the git panel commit message text area.

Description

Steps to trigger the problem:

  1. Open the Agent panel
  2. Type hello world into the text area and then quickly hit the space key twice

Actual Behavior: Two spaces are inserted Expected Behavior: One period and one space is inserted

Zed Version and System Specs

Zed: v0.186.8 (Zed) OS: macOS 15.5.0 Memory: 16 GiB Architecture: aarch64

fredrikekelund avatar May 15 '25 06:05 fredrikekelund

Hey @fredrikekelund, I haven't investigated what other agent-powered editors do. Curious, are you coming from another one where they do this?

JosephTLyons avatar May 20 '25 14:05 JosephTLyons

I am indeed coming from Cursor, where this behavior is implemented.

However, I should clarify that this is the system standard for text fields on macOS. The comment text field that I'm typing in right now (here on GitHub) supports it. TextEdit, Messages, GitHub Desktop, and other apps also support it.

fredrikekelund avatar May 21 '25 09:05 fredrikekelund

Gotcha, I know it's a standard on a lot of macOS apps and websites and such, but didn't realize any text editors implemented it for some fields. Thanks for letting me know!

JosephTLyons avatar May 25 '25 22:05 JosephTLyons

It actually seems like this is a general Zed missing feature, not specifically agent-related; it doesn't work generally in text areas that are not buffers. Part of me wonders if we really need to support this, but maybe we should because it seems like the baseline expectation of most text surfaces (that aren't a code editor). That said, I'll remove the agent label and edit the title and description.

danilo-leal avatar May 28 '25 14:05 danilo-leal

On macOS, this is optionally enabled and exposed as NSAutomaticPeriodSubstitutionEnabled in NSUserDefaults. Ideally Zed should respect the user's OS preference. This is GUI accessible under System Preferences -> Keyboard -> "Edit" (next to Input Sources) -> "Add Period with Double Space"

I think this is ultimately part of a larger set of OS native control integrations which Zed does currently not support: Text Replacements: e.g. omw becomes On my way!, auto-capitalization, spelling correction, inline predictive text, etc.

Even if some of those are awful in a coding editor like "smart quotes and dashes" there are potentially accessibility reasons to consider supporting others.

Image

notpeter avatar Aug 19 '25 20:08 notpeter

Hi there! 👋 We're working to clean up our issue tracker by closing older bugs that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and it will be kept open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, it will close automatically in 14 days. Thanks for your help!

github-actions[bot] avatar Nov 19 '25 11:11 github-actions[bot]

I can still reproduce it in the latest version of Zed

fredrikekelund avatar Nov 20 '25 11:11 fredrikekelund