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

Force Control keys to lower case (ctrl-a instead of ctrl-A) #1875

Closed
flashcode opened this issue Jan 29, 2023 · 0 comments
Closed

Force Control keys to lower case (ctrl-a instead of ctrl-A) #1875

flashcode opened this issue Jan 29, 2023 · 0 comments
Assignees
Labels
feature New feature request
Milestone

Comments

@flashcode
Copy link
Member

Feature description

Actual behavior

When binding a Control key like ctrl-Q, WeeChat expects it to be upper case.

That means with such command:

/key bind ctrl-q /print test

The key ctrl-q is accepted and added but does not work. This is misleading for the user.

Proposed behavior

Purpose is to force lower case when a Ctrl key is added, for example with this command:

/key bind ctrl-Q /print test

The output should be (note that it's added in lower case):

New key binding (context "default"): ctrl-q => /print test

And when trying to unbind a ctrl key with upper case, the lower case letter should be removed:

/key unbind ctrl-Q

Output:

Key "ctrl-q" unbound (context: "default")

Upgrading from old version

The upgrade of keys to the new format (lower case) is completely transparent for the user.

When upgrading WeeChat (either with /upgrade) or starting it with old config files, the ctrl-X keys (in upper case) are automatically converted to ctrl-x (lower case).
The keys are converted to lower case, either when loaded from weechat.conf or when doing manual /key bind ctrl-X /something.

Be careful, running an old WeeChat version with this new config will not work, as all Ctrl keys will be lower case and WeeChat will not recognize them (so for example an essential key like Enter will not work any more).

@flashcode flashcode added the feature New feature request label Jan 29, 2023
@flashcode flashcode added this to the 3.9 milestone Jan 29, 2023
@flashcode flashcode self-assigned this Jan 29, 2023
flashcode added a commit that referenced this issue Jan 29, 2023
…not freed (issue #1875)

This frees some allocated memory if size_alloc was greater than size in the
dynamic string.
flashcode added a commit that referenced this issue Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

1 participant