Fixed mouse movement handling when the position is greater than 127#665
Fixed mouse movement handling when the position is greater than 127#665panicz wants to merge 1 commit into
Conversation
😂 |
|
Indeed that is pretty funny to use a pull request for it :D But, I can explain what Claude Code suggested here. So first, the changes on MouseCharacterPattern.java, are completely unrelated to the issue you are trying to fix. (The changes on this file do basically the same thing, just written in a different way) As the X10/UTF-8(1005) mode is very messy (many softwares preferred to rely on the SGR(1006) mode), the changes will process the input at byte level instead of char level, then if it detects the X10/UTF-8(1005) mode, it will convert the mouse coordinates and button to SGR(1006) then pass the result to InputDecoder. And for the record, Here is why it is not working as you expected in the first place : That's why many softwares preferred the 1006 mode, which is easier to parse and not prone to coordinate encoding difference. To be honest, I think it is more up to the Windows terminal (used in WSL2) to support properly the SGR mode, as it is a standard since 2012 as I explained in the pull request #631. If I was Claude code, I would have suggested you to just use a different terminal which would be compliant. It would have saved up you some headaches and Claude code tokens ;) |
|
as a comment if someone want to implement that trick, the current PR does not do it efficiently, because it will add an overhead on each input, whether it is mouse or not, and even when it's mouse, whether it is X10 or not. |
|
I agree, would be good if we can apply this only when X10 mode is enabled |
There is a bug which manifests itself when one tries to use mouse pointer on the right hand side of a high-resolution terminal.
Claude Code came up with a hypothesis that I don't fully understand, and proposed a patch I don't fully understand, which seems to solve the issue.
I'm not claiming that this should be merged, but I'm sharing it for a possible future analysis.