Repository navigation
iOS: hidden native text input for working hold-to-repeat backspace + dictation (supersedes the hasText approach) #5596
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c3a0228
iOS: native hold-to-repeat backspace + system dictation (iSH-style te…
lawrencecchen 5479693
iOS terminal paste: gate on host capability + route the Paste button …
lawrencecchen 4babcdd
iOS terminal paste: clear paste capability on connection reset
lawrencecchen 0a9d8ad
iOS terminal paste: full DocC on default didPasteText handler
lawrencecchen 98e54b7
iOS terminal input: documentless UIKeyInput+UITextInput responder for…
lawrencecchen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Packages/CmuxMobileTerminal/Sources/CmuxMobileTerminal/TerminalInputTextPosition.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import UIKit | ||
|
|
||
| /// An opaque text position for the terminal input view's hand-rolled | ||
| /// ``UITextInput`` conformance. | ||
| /// | ||
| /// ``TerminalInputTextView`` is a remote-terminal proxy: it owns no editable | ||
| /// document, so it never exposes real character offsets. UIKit's text-input | ||
| /// machinery (IME composition, the dictation placeholder, the "speak selection" | ||
| /// action) still requires the view to vend `UITextPosition`/`UITextRange` | ||
| /// instances, so this is a sentinel with no addressable offset. It exists only | ||
| /// to satisfy the protocol's identity requirements; the geometry/offset methods | ||
| /// that would consume it all return neutral values. | ||
| final class TerminalInputTextPosition: UITextPosition {} |
29 changes: 29 additions & 0 deletions
29
Packages/CmuxMobileTerminal/Sources/CmuxMobileTerminal/TerminalInputTextRange.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import UIKit | ||
|
|
||
| /// An opaque text range for the terminal input view's hand-rolled | ||
| /// ``UITextInput`` conformance. | ||
| /// | ||
| /// Like ``TerminalInputTextPosition``, this carries no real document offsets. | ||
| /// ``TerminalInputTextView`` keeps two long-lived range sentinels — one | ||
| /// identifying the IME marked-text region, one identifying the (always empty) | ||
| /// selection — and returns the matching sentinel from `markedTextRange` / | ||
| /// `selectedTextRange`. UIKit compares ranges by object identity here, so the | ||
| /// view can answer `textInRange:` by checking which sentinel it was handed | ||
| /// rather than by indexing a buffer it does not keep. | ||
| final class TerminalInputTextRange: UITextRange { | ||
| private let position = TerminalInputTextPosition() | ||
|
|
||
| /// The start of the range. Both ends return the same sentinel position | ||
| /// because the range addresses no real document span; callers only use it | ||
| /// for identity comparison, never to compute offsets. | ||
| override var start: UITextPosition { position } | ||
|
|
||
| /// The end of the range. Returns the same sentinel as ``start`` (see the | ||
| /// note there): the range has no measurable length. | ||
| override var end: UITextPosition { position } | ||
|
|
||
| /// Always reports empty. The view never holds a non-empty selection, and the | ||
| /// marked-text contents are tracked out of band by the view, not via a | ||
| /// measurable range here. | ||
| override var isEmpty: Bool { true } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normalize CRLF before CR fallback conversion.
Line 1463 replaces
\nwith\rdirectly, so Windows-style\r\nbecomes\r\ron old-host fallback and can inject extra Returns.Suggested fix
🤖 Prompt for AI Agents