Repository navigation
Conversation
mitchellh
left a comment
There was a problem hiding this comment.
There's some stylistic Zig stuff here I want to fix but willing to do later.
|
Hi @mitchellh is this PR good to go or pending anything? |
|
Hello. Refresh requiredThe fix is still valid and the full The required API refresh is limited to these changes in -const cells = row_pin.node.data.getCells(rac.row);
+const cells = row_pin.node.page().getCells(rac.row);And in both newly added tests: const testing = std.testing;
const alloc = testing.allocator;
+const io = testing.io;
-var s = try init(alloc, .{ .cols = ..., .rows = 5, .max_scrollback = 0 });
+var s = try init(io, alloc, .{ .cols = ..., .rows = 5, .max_scrollback_bytes = 0 });VerificationI created a local merge of the PR into current zig fmt --check src/terminal/Screen.zig
zig build test -j1 -Dtest-filter="promptClickMove"Both completed successfully (
Environment:
AI assistance disclosure: I used Hermes Agent(with LLM GPT 5.6 Sol) to inspect the current upstream state, prepare the local refresh, run the test matrix, and draft this report. I reviewed the changes and results. Guys, could you please help with this PR @mitchellh @hlcfan |
|
Thanks @PRIHLOP for reporting this. Updated the code according to the API change. |
|
Hello @mitchellh |
|
Hello @jcollie |
jcollie
left a comment
There was a problem hiding this comment.
Should also add a test that has a starship-style prompt that looks like the prompt in the issue.
|
@hlcfan can you rebase instead of merging main? |
688bc26 to
5ad2b6d
Compare
|
@jcollie Done. |
|
@jcollie @mitchellh is it good to go? |
Fix #11462
Bug
When user clicks on a purely prompt line without input area, it moves the cursor
to the start of the input. For example, I use starship prompt, it shows a whole
line for the prompt, e.g.
When user double clicks on the prompt area to copy text, the cursor shouldn't
move.
Fix
In
promptClickLine, when user clicks on a prompt area, it traverses down theprompt rows. If one of the rows contains input, allows the cursor movement.
Otherwise, if pure prompt line, return zero movement.
AI Usage
I used Antigravity to pinpoint the prompt area clicking logic.