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

Erroneous behavior if partial command is followed by another command #543

Open
gwsw opened this issue Jul 9, 2024 · 1 comment
Open

Comments

@gwsw
Copy link
Owner

gwsw commented Jul 9, 2024

Steps to reproduce:

  1. Run less in an xterm window.
  2. Enter G.
  3. Enter :.
  4. Press HOME.

Expected:
The : should be ignored and the HOME key should jump to the start of the file.

Actual:
The help file is opened.

Explanation:
On an xterm, HOME maps to "\eOH". When less sees the sequence ":\e" it treats it as a bad command and discards both characters. Then it processes the "O" and the "H" as separate commands.

Discovered while investigating #523.

gwsw added a commit that referenced this issue Jul 10, 2024
Change [fe]cmd_decode so instead of returning only commands that
match the entire cmd string, we return commands that match a tail
of the cmd string. This allows spurious leading chars in command
entry to be ignored.
Related to #543.
@gwsw
Copy link
Owner Author

gwsw commented Jul 10, 2024

Should be fixed in 6a6aa61.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant