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

Unable to create bindings for home/end keys #5371

Closed
anlar opened this issue Dec 10, 2024 · 4 comments
Closed

Unable to create bindings for home/end keys #5371

anlar opened this issue Dec 10, 2024 · 4 comments

Comments

@anlar
Copy link

anlar commented Dec 10, 2024

I'm trying to create binding which will use home/end keys. I have tried to use home and end codes, but they are not working.

From textual keys log:

Key(key='insert', character=None, name='insert', is_printable=False)
Key(key='delete', character=None, name='delete', is_printable=False)
Key(key='pageup', character=None, name='pageup', is_printable=False)
Key(key='pagedown', character=None, name='pagedown', is_printable=False)
Key(key='\x01', character='\x01', name='\x01', is_printable=False)
Key(key='\x04', character='\x04', name='\x04', is_printable=False)
Key(key='ctrl+a', character='\x01', name='ctrl_a', is_printable=False)
Key(key='ctrl+d', character='\x04', name='ctrl_d', is_printable=False)

Home and End are mapped as \x01 and \x04 which are not working in binding either.

textual diagnose:

## Versions                                                                                                                                                                                   
                                                                                                                                                                                              
| Name    | Value  |                                                                                                                                                                          
|---------|--------|                                                                                                                                                                          
| Textual | 0.89.1 |                                                                                                                                                                          
| Rich    | 13.9.4 |                                                                                                                                                                          
                                                                                                                                                                                              
## Python

| Name           | Value                                       |
|----------------|---------------------------------------------|
| Version        | 3.12.3                                      |
| Implementation | CPython                                     |
| Compiler       | GCC 13.2.0                                  |
| Executable     | /home/anlar/dev/anlar/tewi/venv/bin/python3 |

## Operating System

| Name    | Value                                                       |
|---------|-------------------------------------------------------------|
| System  | Linux                                                       |
| Release | 6.8.0-49-generic                                            |
| Version | #49-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov  4 02:06:24 UTC 2024 |

## Terminal

| Name                 | Value         |
|----------------------|---------------|
| Terminal Application | tmux (3.4)    |
| TERM                 | tmux-256color |
| COLORTERM            | truecolor     |
| FORCE_COLOR          | *Not set*     |
| NO_COLOR             | *Not set*     |

## Rich Console options

| Name           | Value                |
|----------------|----------------------|
| size           | width=190, height=48 |
| legacy_windows | False                |
| min_width      | 1                    |
| max_width      | 190                  |
| is_terminal    | True                 |
| encoding       | utf-8                |
| max_height     | 48                   |
| justify        | None                 |
| overflow       | None                 |
| no_wrap        | False                |
| highlight      | None                 |
| markup         | None                 |
| height         | None                 |
Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@willmcgugan
Copy link
Collaborator

Have you tried it outside of tmux ?

@anlar
Copy link
Author

anlar commented Dec 10, 2024

Thanks for the hint. Yes, it works fine outside of tmux. It is caused by tmux-256color terminfo (with khome=\E[1~ instead of khome=\EOH).

@anlar anlar closed this as completed Dec 10, 2024
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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