Skip to content

Add ⌘K Clear to Start for the integrated terminal - #2187

Open
Borisserz wants to merge 2 commits into
CodeEditApp:mainfrom
Borisserz:feature/891-terminal-clear-to-start
Open

Add ⌘K Clear to Start for the integrated terminal#2187
Borisserz wants to merge 2 commits into
CodeEditApp:mainfrom
Borisserz:feature/891-terminal-clear-to-start

Conversation

@Borisserz

@Borisserz Borisserz commented Jul 29, 2026

Copy link
Copy Markdown

Description

Implements ⌘K in the integrated terminal so it clears the screen and the scrollback, the same way Terminal.app and VS Code do it.

I hooked this up on the terminal view itself: when it has focus and the option is on, ⌘K runs a clear that only touches the emulator buffer (nothing goes to the shell). There’s a new toggle in Terminal Settings — Clear to Start with ⌘K — and it’s on by default, which matches what #891 asked for.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

No layout changes besides the new settings toggle.

Test plan

  • Unit tests cover the setting defaults/decoding and that clearToStart() wipes viewport + scrollback
  • Focus the terminal, print some output, hit ⌘K — screen and scrollback should be empty
  • Turn off Clear to Start with ⌘K — ⌘K shouldn’t clear anymore
  • Confirm ⌘K doesn’t do anything weird when the editor (not the terminal) is focused

When the terminal is focused, ⌘K clears the screen and scrollback, like
Terminal.app. There's a setting to turn it off; it stays on by default.
Unblocks SwiftLint CI on the PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Add "Clear To Start" (⌘K) shortcut to integrated terminal

1 participant