Add line-by-line terminal scroll (Cmd+Swipe gesture & Cmd+Arrow keys)#2255
Add line-by-line terminal scroll (Cmd+Swipe gesture & Cmd+Arrow keys)#2255elevateconsultingdave wants to merge 2 commits into
Conversation
When using Blink as a remote terminal for tools like Claude Code, the inability to scroll back through output line-by-line makes reviewing long responses impractical. This adds two complementary scroll mechanisms: Keyboard: Cmd+Up and Cmd+Down scroll the terminal one line at a time, wired through the standard shortcut pipeline (KeyBindingAction, KeyShortcut defaults, MenuController, SpaceController, TermView). KBTracker.loadConfig() auto-merges new defaults so no migration is needed. Touch: holding Command while panning on the terminal scrolls line-by-line proportional to finger movement (20pt per line). This lets you scrub through scrollback quickly without lifting your finger. Both delegate to hterm's existing scrollLineUp/scrollLineDown JS methods, keeping the UIScrollView offset in sync via the existing scrollTo bridge. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Xcode auto-generated changes from opening the project in Xcode 26: project upgrade check, scheme updates, parallel build flag, and entitlements formatting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hey, thanks for giving this a try! I have to say, in this case I am a bit "disoriented" by the message. Blink supports scroll line by line by using your finger, and depending on the speed it will go faster and get inertia. So "Page-level scroll is too coarse, and there was no line-level mechanism available" does not hold true. Actually, Blink supports what this fix is supposed to do, except for the "line-by-line" using the keyboard. Mosh does not support scroll, and that is why we usually mix it tmux (#1933). I get that maybe we want to have line-by-line scroll using the keyboard? Or maybe even page by page using the keyboard (like pgUp or pgDown)? But that's not what this does. I cannot test this because the commit has files that are beyond the fix - your team ID, version changes on schemas, etc... On code review, it does not look like this does what the message says it does (pan is the wrong gesture for this, the gestures that depend on pan are probably broken, etc...). So let's start again. What do you want to do? |
|
Right on, appreciate you getting back to me. It's definitely a special case. Here's the situation: I'm going on a trip and want to be able to connect to Claude Code in the terminal while I'm remote. I'm new to the app, so I installed it on my phone to test it out. The issue is that when I'm in the Claude UI or TUI and swipe up or down on the screen, it pulls the next or previous messages instead of scrolling. That was the motivation behind the change.
Totally agree it's an edge case, and if there's a better way to handle it without introducing new functionality, I'm all ears.
***@***.***?anonymous&ismsaljsauthenabled&ep=bwmEmailSignature>
Book time to meet with ***@***.***?anonymous&ismsaljsauthenabled&ep=bwmEmailSignature>
…________________________________
From: carloscabanero ***@***.***>
Sent: Friday, May 8, 2026 9:19 AM
To: blinksh/blink ***@***.***>
Cc: Dave King ***@***.***>; Author ***@***.***>
Subject: Re: [blinksh/blink] Add line-by-line terminal scroll (Cmd+Swipe gesture & Cmd+Arrow keys) (PR #2255)
[https://avatars.githubusercontent.com/u/536729?s=20&v=4]carloscabanero left a comment (blinksh/blink#2255)<#2255 (comment)>
Hey, thanks for giving this a try!
I have to say, in this case I am a bit "disoriented" by the message. Blink supports scroll line by line by using your finger, and depending on the speed it will go faster and get inertia. So "Page-level scroll is too coarse, and there was no line-level mechanism available" does not hold true. Actually, Blink supports what this fix is supposed to do, except for the "line-by-line" using the keyboard.
Mosh does not support scroll, and that is why we usually mix it tmux (#1933<#1933>).
I get that maybe we want to have line-by-line scroll using the keyboard? Or maybe even page by page using the keyboard (like pgUp or pgDown)? But that's not what this does.
I cannot test this because the commit has files that are beyond the fix - your team ID, version changes on schemas, etc... On code review, it does not look like this does what the message says it does (pan is the wrong gesture for this, the gestures that depend on pan are probably broken, etc...).
So let's start again. What do you want to do?
—
Reply to this email directly, view it on GitHub<#2255 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A3BDAHSXIW4T7UW6EJNKX3T4ZX3HZAVCNFSM6AAAAACYWC4FZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DIMBXGU3DCNZRG4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
That makes more sense now. So here is how we currently make this work, and let me know if after trying it out you think we would still need any more changes:
Note the behavior is part of ssh or mosh, and Blink just adapts to it the best way possible. So the PR would not fix the situation with scroll under mosh, and the functionality already exists on ssh. One more thing, specially interesting with the phone. I added prompt mode as well. You can turn it on with Cmd+< (in the software keyboard too). While on scratch mode, you can use the microphone, autocorrect works, you can "scroll" the buffer on tmux or ssh all the same, so you can check out what the AI wrote and prepare the reply. When ready, it will send directly to Claude. And last, you can "Pin" the mode so that you can work on the next input, etc... This mode is part of Snips itself so also very useful to prepare a command in an interface before sending it to the remote. Let me know. |
Summary
Motivation
When using Blink as a remote terminal for CLI tools with verbose output (Claude Code, build logs, git diffs), the lack of fine-grained scroll control makes reviewing output impractical. Page-level scroll is too coarse, and there was no line-level mechanism available.
The Cmd+Swipe gesture is particularly valuable on iPad with a Magic Keyboard — hold Command and drag to scrub through output naturally.
Implementation
Both mechanisms delegate to hterm's existing
scrollLineUp()/scrollLineDown()JS methods, keeping the UIScrollView offset in sync via the existingscrollTobridge.Keyboard shortcuts follow the standard 5-file pipeline:
KeyBindingAction→KeyShortcutdefaults →MenuController→SpaceController→TermViewKBTracker.loadConfig()auto-merges new defaults into existing user configs, so no migration is needed.Cmd+Swipe intercepts the existing
_pan:gesture recognizer whenUIKeyModifierCommandis held, accumulating vertical translation with a 20pt-per-line threshold before delegating toscrollLineUp/scrollLineDown.Test plan
🤖 Generated with Claude Code