Skip to content

Synchronize keyboard input context after completion - #1148

Draft
demrom wants to merge 1 commit into
holzschu:masterfrom
demrom:fix/completion-delete-context
Draft

demrom wants to merge 1 commit into
holzschu:masterfrom
demrom:fix/completion-delete-context

Conversation

@demrom

@demrom demrom commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

After cd ~/D + Tab, holding the onscreen Delete key stops before the completed line is empty. Completion updates the host editor, but UIKit still holds only the characters typed before Tab.

Reuse synchronizeRecalledInputContext(_:) from #1137 after Tab completion, right-arrow suggestion acceptance, and updateAutocomplete in the typed-character path. That last path can append a unique match's remaining text, a common prefix, or an option's argument separator. All three calls are in a-Shell/SceneDelegate+TerminalView.swift.

Tested in a development build of a-Shell 2.2.2 on a physical iPhone. Tab completed cd ~/D to cd ~/Documents/ (15 characters). Before the fix, UIKit held 6 characters; two 5-second Delete holds removed 6 characters total and left cd ~/Docu (9 characters). With the fix, UIKit held all 15 characters and one 5-second hold cleared both the terminal line and UIKit input.

Also tested typing c after Tab with Documents/ and Downloads/ as matches for cd ~/tmp/p/D. Completion produced cd ~/tmp/p/Documents/. Before the fix, UIKit held cd ~/tmp/p/Dc and an 8-second Delete hold left cd ~/tmp in the terminal. With the fix, the same hold cleared the line. Repeat-Tab and right-arrow acceptance, mid-line completion, z expansion, and marked-text input remain untested on the phone.

Refs #1137.

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.

1 participant