Irssi core bugs

Notice: Undefined index: tasklist_type in /var/www/bugs.irssi.org/includes/class.tpl.php(128) : eval()'d code on line 85 Notice: Undefined index: tasklist_type in /var/www/bugs.irssi.org/includes/class.tpl.php(128) : eval()'d code on line 90
  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category core
  • Assigned To No-one
  • Operating System Linux
  • Severity Medium
  • Priority Normal
  • Reported Version Irssi 0.8.12
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 0
  • Private No
Attached to Project: Irssi core bugs
Opened by David Guedj (dguedj) - 2008-01-06

FS#553 - can't bind accented characters

Accented characters (like é, è, à, ù) are not recognized in bindings.
This is probably due to the fact irssi is waiting for a 8 bits char while those are 16+ bits in UTF-8 encoding.

If '/bind' is used to list all the bindings, all those which are composed of accented characters are actually shifted from one space to the left (This is what me think it's a encoding issue)

meta-1 change_window 1
meta-é change_window 2
meta-4 change_window 4

Here is the relevant part of my xorg config concerning keyboard:
--
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "fr"
--

This task does not depend on any other tasks.

Laurent Bigonville (bigon)
Thursday, 12 March 2009, 09:22 GMT
any information about this bug?

I discover that if I set term_charset to something else than utf-8 I'm able to use accentuated chars
Christophe (Tito1337)
Wednesday, 08 April 2009, 22:27 GMT
Exactly the same bug for me...

I'll add that it I set my term in ISO :
/set term_charset ISO-8859-1
And then
/bind meta-é change_window 2
...it works.

But actually my term_charset is UTF-8 (system-wide) and it doesn't work.
Matt Wheeler (funkyhat)
Thursday, 03 September 2009, 20:45 GMT
I can also confirm this bug.
bind meta+£ does not work.
Martti Roitto (maraz)
Friday, 04 September 2009, 16:55 GMT
Confirmed. UTF-8 multibyte characters do not work in key bindings, for example meta-ö, meta-ä and meta-shift-4 cannot be bound on Scandinavian keyboard layouts.
8gre984g (8gre984g)
Friday, 11 September 2009, 20:47 GMT
Same problem here on windows with cygwin&puttycyg.
kyak (kyak)
Thursday, 15 April 2010, 06:13 GMT
The following modification made it work for me.
If this patch seems reasonable for you, please use it.

--- src/fe-common/core/keyboard.c (revision 5140)
+++ src/fe-common/core/keyboard.c (working copy)
@@ -569,8 +569,15 @@
}

first_key = keyboard->key_state == NULL;
- combo = keyboard->key_state == NULL ? g_strdup(key) :
- g_strconcat(keyboard->key_state, "-", key, NULL);
+ if (keyboard->key_state == NULL) {
+ combo = g_strdup(key);
+ } else if (g_utf8_validate(key, 2, NULL)) {
+ char wchar[256];
+ g_snprintf(wchar, sizeof(wchar), "%c-%c", key[0], key[1]);
+ combo = g_strconcat(keyboard->key_state, "-", wchar, NULL);
+ } else {
+ combo = g_strconcat(keyboard->key_state, "-", key, NULL);
+ }
g_free_and_null(keyboard->key_state);

rec = g_tree_search(key_states,
Thomas Jost (Schnouki)
Wednesday, 11 August 2010, 10:07 GMT
Same problem here (Linux, rxvt-unicode). This patch fixes the issue.
Olivier Raginel (Babar)
Thursday, 05 May 2011, 07:59 GMT
So Rhonda put it into Debian, and here is what happened:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625690

I guess this patch needs refinement :(
kyak (kyak)
Tuesday, 24 May 2011, 17:37 GMT
Heh, so it only took more than a year to find out consequencies of proposed patch :)

I myself never used Alt(Esc)+arrows, but i confirm that the first patch have broken it.

Anyway, attached is another version of patch, so far i don't face any problem with that (utf-8 bindings work, alt+left-right arrows work).

Btw, alt+up/down doesn't work for me with our without any patch (guess it's my terminal or according irssi binding is missing by default).

kyak (kyak)
Tuesday, 24 May 2011, 18:28 GMT
Heh, so it only took more than a year to find out consequencies of proposed patch :)

I myself never used Alt(Esc)+arrows, but i confirm that the first patch have broken it.

Anyway, attached is another version of patch, so far i don't face any problem with that (utf-8 bindings work, alt+left-right arrows work).

Btw, alt+up/down doesn't work for me with our without any patch (guess it's my terminal or according irssi binding is missing by default).

kyak (kyak)
Tuesday, 24 May 2011, 18:51 GMT
Someone was right, it also depends on terminal if the patch affects alt+arrows.. Let's see if this patch works better (tested in gnome-terminal and putty).
Marien Zwart (marienz)
Friday, 14 October 2011, 09:29 GMT
Debian (and ubuntu) seem to be applying this alternate patch now. Unfortunately it breaks alt+backspace for me (which used to delete the word to the left of the cursor) using my usual irss in tmux through ssh in rxvt-unicode setup (all using utf-8). Specifically it turns what used to be "^[-^?" into "^[-^-?".

I have created an alternate patch which leaves alt+backspace working, and *might* also fix the original problem, but I've not yet played around with remapping my keyboard enough to be able to test that. It's based on a guess at what the first patch was trying to do: fix up multibyte utf-8 input (and only that) to match the table used for keybindings. But instead of trying to list multibyte inputs that should not be munged (as the updated patch tries) this one checks if the input is valid utf-8 (like the original patch did) and a single character (the original patch did not have that check, causing it to accept multiple ascii characters as seen in encoded escaped characters).

Oh, and I just realized this patch is still wrong for utf-8 sequences longer than one byte (but so were the previous patches).

Does this approach make sense?
Marien Zwart (marienz)
Friday, 14 October 2011, 21:21 GMT
My previously attached patch was crap. Please ignore it.

I thought about this some more, and I think it makes more sense to add multibyte utf-8 sequences to keystates correctly (that is: with the utf-8 sequence intact instead of broken up with '-' characters). The final "else" case in expand_key (which is what's hit for these keys) just seems to assume a unibyte encoding when it inserts those '-'s.

So here's an ugly patch that picks up utf-8 in expand_key and preserves it. This time I actually tested not just that alt+backspace still works but also that alt+eurosign can now be bound, and it seems to do the trick.

Thoughts?

Loading...