Skip to content
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

How to configure control-left and control-right to be recognized by less? #511

Closed
minnesjay opened this issue May 17, 2024 · 1 comment
Closed

Comments

@minnesjay
Copy link

^LeftArrow and ^RightArrow do not go to the first and last column respectively.
Is there a lesskey configuration that fixes this if less does not recognize the ctrl key on a platform?

@gwsw
Copy link
Owner

gwsw commented May 17, 2024

What operating system are you running on? There is no standard way for less to determine the sequence sent by ctrl+arrow keys on Linux (if the terminal even sends anything for such keypresses; some terminals just ignore it) because terminfo and termcap do not support such keys. So there are two choices: you can either use the alternate commands (ESC-{ or ESC-}), or define terminal-specific commands in your lesskey file. For example, if you know that your terminal sends ESC[1;5D for ctrl+left-arrow and ESC[1;5C for ctrl+right-arrow, you could add these lines to your lesskey file

\e[1;5D no-scroll
\e[1;5C end-scroll

But this would only work with that specific type of terminal.

@gwsw gwsw closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
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

No branches or pull requests

2 participants