Skip to content

Enhancement: Respect macOS “double-space for period” system preference #6078

@smalyu

Description

@smalyu

What feature would you like to see?

Summary
Make the editor/chat composer convert a trailing double space into “. ��� only when the macOS system preference Add period with double-space is enabled. Otherwise, keep the current behavior.

Motivation
Many macOS users rely on this shortcut across native apps. When Codex ignores the OS preference, fast typing yields two spaces instead of a period, causing friction and backspacing. Matching the OS setting reduces surprise and makes the UI feel native.

Proposed behavior

  • Respect the macOS preference: enable auto-period only when that system option is on.
  • Do not alter indentation or alignment: ignore double spaces at the start of a line or in whitespace-only lines.
  • Trigger only when the current line already has non-whitespace characters (so code indentation, markdown lists, etc. are untouched).
  • Provide a small toggle if needed (e.g., editor.autoPeriodFromDoubleSpace: auto | on | off; default auto).

Why it’s safe

  • No breaking changes for non-macOS users or for macOS users who keep the OS option off.
  • Scope is limited to the text-entry handler; no protocol/API changes.

Alternatives considered

  • Always on: breaks indentation and surprises non-macOS users.
  • Always off: ignores a common macOS typing convention and slows input.

Prior work
I previously opened PR #5818 implementing this approach: #5818. The PR was closed while new features aren’t being accepted. I’m ready to rebase, split into smaller commits, add tests/docs, and reopen if maintainers think this direction fits.

Request
If this is acceptable in principle, please advise on preferred flags/guardrails.
If others want this too, please react with 👍 to help prioritization.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions