You are not logged in.

#1 2010-10-02 12:19:58

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

accent keys/tilde keys ignored in urxvt

I've recently been noticing a problem when using vim.  On the DE layout there's a tilde key that can be reached by hitting "alt gr" and "+", which works fine in my terminal, firefox, etc. (It's a "dead key", thus requiring a double-press, but I don't mind that at all), and my accent key (` and ´) is available without a modifier key (again, it works in most programs). 

However, in Vim (and Nano as well - but otherwise no other applications show this behaviour), neither key results in a character.  I can use the ctrl+k method in vim and copying/pasting the character works as well, but this seems kind of pointless to me, since I have the keys on my keyboard (and they worked previously).  It's as if the keypress is ignored entirely (such as loading a 102 key layout for a 104 key keyboard results in "empty" keys).

Would this be a setting in my zshrc or my vimrc, or is this a locales problem?  Or did Vim simply change that functionality in an update?

I'm unsure of where I should look for a solution and googling for results hasn't yet returned a working solution.  On a possibly related note, I have also noticed that my middle-mouse-key copy and paste has stopped working from urxvt.  I can highlight the text and paste it within the same terminal, but I can't paste it into, for example, Firefox.  The only change I remember making before I noticed this problem popping up is the fact that I configured SCIM.

I've tried to include as much information as I found relevant, but I will happily provide any more information that may be required.

More information:
.vimrc

 filetype on

" Variables
set showmatch
set softtabstop=2
set expandtab
set incsearch
set backspace=2 
set ignorecase
set comments=sl:/*,mb:*,elx:*/
set number
set pdev=Cups-PDF
set printoptions=paper:A4,syntax:y,wrap:y
set encoding=utf8

"Keyboard Shortcuts
nmap <C-l> :set invnumber <CR>
noremap <C-B> yiW<End>=<C-R>=<C-R>0<CR>
imap <S-CR>    <CR><CR>end<Esc>-cc

inoremap <s-tab> <c-d>
noremap <Space> <PageDown>
noremap <BS> <PageUp>
noremap - <PageUp>

nmap <c-s> :w<CR>

imap <C-F> {<CR>}<C-O>O

"Syntax Highlighting
set background=dark
syntax enable
colorscheme lswest

au BufNewFile,BufRead *.rhtml set syn=eruby  
autocmd BufRead ~/.mutt/temp/mutt*   :source ~/.vim/mail.vimrc

.zshrc

autoload colors; colors
autoload -U url-quote-magic
zle -N self-insert url-quote-magic

##RPROMPT="%{$fg[red]%}[%{$fg[cyan]%}%* on %D%{$fg[red]%}]%{$reset_color%}" # Prompt for right side of screen

# prompt (if running screen, show window #)
if [ x$WINDOW != x ]; then
    # [5:lswest@lswest-laptop:~] 
    export PS1="%{$fg[white]%}┌─[%{$fg[cyan]%}$WINDOW%{$fg[white]%}:%{$fg[green]%}%n%{$fg[cyan]%}@%{$fg[green]%}%m%{$fg[white]%}:%{$fg[yellow]%}%~%{$fg[white]%}]%{$fg[yellow]%}-%{$fg[red]%}[%{$fg[cyan]%}%*%{$fg[red]%}]%{$reset_color%}%{$reset_color%}"$'\n'"%{$fg[white]%}└─>%{$reset_color%} "
else
    # [lswest@lswest-laptop:~] 
    export PS1="%{$fg[white]%}┌─[%{$fg[green]%}%n%{$fg[cyan]%}@%{$fg[green]%}%m%{$fg[white]%}:%{$fg[yellow]%}%~%{$fg[white]%}]%{$fg[yellow]%}-%{$fg[red]%}[%{$fg[cyan]%}%*%{$fg[red]%}]%{$reset_color%}%{$reset_color%}"$'\n'"%{$fg[white]%}└─>%{$reset_color%} "
fi
export RPRMOPT="%{$reset_color%}"

# format titles for screen and rxvt
function title() {
  # escape '%' chars in $1, make nonprintables visible
  a=${(V)1//\%/\%\%}
 
  # Truncate command, and join lines.
  a=$(print -Pn "%40>...>$a" | tr -d "\n")
 
  case $TERM in
  screen*)
    print -Pn "\ek$a:$3\e\\" # screen title (in ^A")
    ;;
  xterm*|rxvt*)
    ##print -Pn "\e]0;$USER@$HOSTNAME: $PWD\007"
    ##print -Pn "\e]2;$2 | $a:$3\a" # plain xterm title
    precmd() { print -Pn "\e]0;%m:%~\a" } 
    preexec () { print -Pn "\e]0;$1\a" }
    ;;
  esac
}

# precmd is called just before the prompt is printed
function precmd() {
  title "zsh" "$USER@%m" "%55<...<%~"
}
 
# preexec is called just before any command line is executed
function preexec() {
  title "$1" "$USER@%m" "%35<...<%~"
}

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt extendedglob
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/lswest/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall

#alias
alias ls="ls -la --classify --color=always"
alias rsync="rsync -h --progress"

##Set some keybindings
###############################################
typeset -g -A key
bindkey '^?' backward-delete-char
bindkey '^[[7~' beginning-of-line
bindkey '^[[5~' up-line-or-history
bindkey '^[[3~' delete-char
bindkey '^[[8~' end-of-line
bindkey '^[[6~' down-line-or-history
bindkey '^[[A' up-line-or-search
bindkey '^[[D' backward-char
bindkey '^[[B' down-line-or-search
bindkey '^[[C' forward-char 
bindkey '^[[2~' overwrite-mode
#################################################

export LC_CTYPE="en_US.utf8"
#export QT_PLUGIN_PATH="$QT_PLUGIN_PATH:/opt/lib32/usr/lib/qt/plugins"

alias trayer="trayer --edge top  --expand true --widthtype request --height 28 --SetDockType true --transparent true --alpha 255 --align right"
alias sbb="sudo bauerbill"
alias bb="bauerbill"
alias linode="ssh lucas.westermann@linode2.kiwilight.com"
alias sockLin="ssh -D 8080 lucas.westermann@linode2.kiwilight.com"

##custom functions
m4a(){
        if [[ "$1" != "" && "$#" == 2 ]]; then
    #check if files exist 
    if [ -e "$1" ]; then
        #convert audio
        ffmpeg -i "$1" "$2"
    else
        echo "File "$1" doesn't exist!"
    fi
    if [ ! -d "$HOME/Music/m4a" ]; then
            mkdir $HOME/Music/m4a
    fi
    #move the .m4a file to the m4a folder if the files exist in the current directory
    if [ -e "$2" ]; then
        mv "$1" $HOME/Music/m4a/"`echo "$2"|sed 's/mp3/m4a/'`"
        echo "m4a file was moved to the ~/Music folder"
        mv "$2" $HOME/Music/
        echo "Moved the mp3 to the ~/Music folder"
    else
        echo "File "$2" doesn't exist!"
    fi
else
    echo "Invalid arguments (or too few/many), please run this script with \"m4a <input> <output>\""
fi
}
# Convert Flash video to MP3
flvmp3() {
      ffmpeg -i $1 -ar 44100 -ab 192k -ac 2 $2
}
export EDITOR="vim"
export BROWSER="firefox"
#Google from CLI
# go to google for anything
google() {
  local term="$*"

  [ -z "$term" ] && term="$(xclip -o)"

  local URL="http://www.google.com/search?q=${term// /+}"

  $BROWSER "$URL" &>/dev/null &
}


export OOO_FORCE_DESKTOP=gnome
export DE=xfce
#set up the mail environment variable
MAIL=/var/spool/mail/lswest && export MAIL

Last edited by lswest (2010-10-03 08:43:50)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#2 2010-10-02 15:27:07

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: accent keys/tilde keys ignored in urxvt

As those are dead keys they wait for a completion, thus AltGr + ~ + a results in ã. To get the tilde on its own I have to complete the dead key with a space, resulting in ~ as wanted.

However this does not depend on vim but is part of the keyboard input interface and works this way anywhere being it within X or in a TTY console (using bash instead of zsh which probably might count).

Last edited by bernarcher (2010-10-02 15:27:59)


To know or not to know ...
... the questions remain forever.

Offline

#3 2010-10-02 15:30:40

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: accent keys/tilde keys ignored in urxvt

I realize this, and hitting the dead key twice results in a single character (as stated in the first line of my previous post).  The characters in the post above were inputted in exactly that fashion.  My problem is that Vim and Nano don't register it at all, as if the keys didn't exist/weren't pressed, regardless of if I hit a key after wards, a space, the same key twice, etc.

I appreciate the reply though!

Last edited by lswest (2010-10-02 15:31:18)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#4 2010-10-03 08:08:31

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: accent keys/tilde keys ignored in urxvt

lswest wrote:

... hitting the dead key twice results in a single character (as stated in the first line of my previous post).

This double press feature on dead keys does not work here since quite a long time. I always have to "complete" a dead key to be used on its own with a following space.

Hence this behaviour is probably a feature of the DE in use. Mine is basically pure Openbox which relies on standard Xorg keyboard input drivers. And these in turn rely on the linux basic input drivers as my TTYs perform dead keys likewise.

It is not sure, however, whether this contributes to your problem. What kind of terminal do you run vim and nano in? I vaguely remember similar issues using xterm about nearly two years ago whith my first Neo keyboard experiments but cannot remember exactly though.

Further, how is your machine set up (32/64 bit)? Mine is x86-64. And how do initiate your keymap in /etc/rc.conf? My LOCALIZATION section in rc.conf looks thus.

LOCALE="de_DE.utf8"
HARDWARECLOCK="UTC"
USEDIRECTISA="no"
TIMEZONE="Europe/Berlin"
KEYMAP="de-latin1"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

Last edited by bernarcher (2010-10-03 08:11:29)


To know or not to know ...
... the questions remain forever.

Offline

#5 2010-10-03 08:31:50

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: accent keys/tilde keys ignored in urxvt

*EDIT* I just checked in Sakura and Vim registers and displays tilde after double-presses, and accents need to be completed with a space (not a big deal for me).  Now I just need to figure out why rxvt-unicode isn't doing the same.  Any suggestions on where to start?

*EDIT #2* The issue is occurring in urxvt itself now (I could swear it was working before though, but I have no concrete evidence of that fact).  Probably means it's related to my rxvt configuration somehow (and the middle-mouse copy/paste not working is probably also related).  I've updated the title to reflect this.

relevant section of my .Xdefaults:

URxvt*preeditType: OnTheSpot,None
URxvt.perl-ext-common: default,matcher,xim-onthespot
URxvt.urlLauncher: firefox
URxvt.matcher.button: 1
urxvt*font:  xft:Inconsolata:size=10:antialias=true:autohint=true
urxvt*termName: rxvt-unicode
urxvt*internalBorder:   1
urxvt*loginShell: true
urxvt*background: [70]#000000
urxvt*foreground:  white
urxvt*transparent: 1
urxvt*colorMode: on
urxvt*cursorBlink: 0
urxvt*depth:    32
urxvt*color0:      #000000
urxvt*color1:      #9e1828
urxvt*color2:      #aece92
urxvt*color3:      #968a38
urxvt*color4:      #414171
urxvt*color5:      #963c59
urxvt*color6:      #418179
urxvt*color7:      #bebebe
urxvt*color8:      #666666
urxvt*color9:      #cf6171
urxvt*color10:     #c5f779
urxvt*color11:     #fff796
urxvt*color12:     #4186be
urxvt*color13:     #cf9ebe
urxvt*color14:     #71bebe
urxvt*color15:     #ffffff
urxvt*fading:    40
urxvt*tintColor: white
urxvt*shading:   0
urxvt*inheritPixmap: 0
urxvt*scrollBar: 0
urxvt*geometry: 81x22
urxvt*saveLines:1000

I appreciate the reply again.

The double-press works in DWM (my WM of choice on my PC) and AwesomeWM (on my laptop, which is also experiencing the same issue) in all applications besides the two I mentioned above.  I've also tried it by ending it with a space, a letter (i.e. n after tilde, or e after an accent) and it results in just the letter (n or e) in Nano/Vim.  The terminal is rxvt-unicode (not the 256 color one from AUR).

My machines are both 64bit setups.

On a side-note, is there any way to check if keypresses are being registered in Vim? (i.e. a way to see the keysym).

relevant section of my rc.conf:

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.utf8"
HARDWARECLOCK="UTC"
USEDIRECTISA="no"
TIMEZONE="GMT+2"
KEYMAP="de"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

Setting my keymap in X:
xorg.conf

Section "InputDevice"
        Identifier "keyboard0"
        Driver "evdev"
        Option  "XkbLayout" "de"
        Option  "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Last edited by lswest (2010-10-03 08:42:54)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#6 2010-10-03 08:51:36

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: accent keys/tilde keys ignored in urxvt

Is your system up to date? Because there still is an "InputDevice" section in your xorg.conf instead of the "InputClass" section used in current xorg-server 1.9.0-1, as in my xorg.conf:

Section "InputClass"
    Identifier      "Keyboard Defaults"
    MatchIsKeyboard "yes"
    Option          "XkbModel" "pc105"
    Option        "XkbLayout" "de"
EndSection

I do use these X input drivers from extra: xf86-input-evdev 2.5.0-1, xf86-input-keyboard 1.4.0-3, xorg-xkb-utils 7.5-2.

Also you could perhaps try "KEYMAP=de-latin1" in your rc.conf.

Btw. I use rxvt-unicode-256color from community. But this should not be the cause as the issues I remember were xterm only.


To know or not to know ...
... the questions remain forever.

Offline

#7 2010-10-03 09:14:24

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: accent keys/tilde keys ignored in urxvt

My system is up-to-date.  The InputDevice section was written manually by me, but it shouldn't be a problem either way since my 10-evdev.conf file in xorg.conf.d has the same settings in an InputClass catchall.  I'll definitely fix that now though, thanks for pointing it out.

I also installed -256color from AUR to see if it changed anything, but it didn't.

I'll give the de-latin1 a try, and let you know if it fixes anything.

*EDIT* Now that I've commented out my inputdevice sections in xorg.conf (leaving the inputclass ones in 10-evdev.conf), and changed the layout in rc.conf to de-latin1...nothing has changed.  Same issue as before.

*EDIT #2* According to Google, this is a known issue with the urxvt if you run it with tabs (which I don't).  Still haven't found a solution for the issue, I may just look around for a different terminal emulator.

Last edited by lswest (2010-10-04 09:05:41)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#8 2010-10-04 13:02:32

cdemoulins
Member
From: Paris
Registered: 2008-04-06
Posts: 7

Re: accent keys/tilde keys ignored in urxvt

I had the same problem. Use the following command in your urxvt :

printf '\33]701;%s\007' "$LANG"

If you want some explanation you can read the faq (or man 7 urxvt) on the official web site :
http://pod.tst.eu/http://cvs.schmorp.de … hod_Issues

Offline

#9 2010-10-04 13:18:12

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: accent keys/tilde keys ignored in urxvt

I appreciate the response.  I've run the command (with both $LANG and $LC_ALL), but tilde and accents still don't show up, and giving in the locale manually (i.e. instead of $LANG or $LC_ALL) also doesn't help.


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#10 2010-10-04 20:48:18

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: accent keys/tilde keys ignored in urxvt

lswest wrote:

*EDIT #2* According to Google, this is a known issue with the urxvt if you run it with tabs (which I don't).  Still haven't found a solution for the issue, I may just look around for a different terminal emulator.

I completely forgot about this one. Yes, this is an issue I sometimes experience after switching windows away from urxvt and back there again. Then the dead keys may not properly work in case the cursor remained outside the urxvt window. Putting the cursor back on the urxvt window in most cases remedies this situation.

However, I have yet to find a pattern in this as this character display problem appears to occur only randomly. It happens most often on tabbed urxvt (presumably the perl interface causes this) but if I properly remember this was in some seldom cases on plain urxvt seen, too.

It would indeed be interesting if this behaviour shows up with other terminal emulators as well. Keep us informed.


To know or not to know ...
... the questions remain forever.

Offline

#11 2010-10-04 20:52:33

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: accent keys/tilde keys ignored in urxvt

So far I can say that the issue doesn't occur with Terminator or Sakura (I've used them all day), but I'll update this post if that changes.  And I still haven't been able to get my dead keys working again in urxvt, but the middle-mouse button copy and paste is fixed (updating my xorg.conf seems to have fixed it, since that was the only change I had made before it started working again) - so thanks for that suggestion.


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#12 2010-10-04 21:03:32

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: accent keys/tilde keys ignored in urxvt

With a similar problem I found that I needed to set

LC_CTYPE="en_US.UTF-8"

to get urxvt to use my keys correctly. (I am not sure if it was to use the dead keys or to use my language specific chars.)
The rest of the locale I have set to en_DK.UTF-8


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#13 2010-10-04 21:22:38

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: accent keys/tilde keys ignored in urxvt

I originally thought it was caused by my locale too, but all locale variables are set to en_US.utf8 (what I use).

*EDIT* In case anyone wants to know how I fixed this (it later cropped up in Terminator), it was due to a setting with scim.  I'm not sure anymore exactly which, but I believe I changed "/FrontEnd/X11/Dynamic" to false in .scim/config.  Either way, there is plenty of information online about the issue with scim.

Last edited by lswest (2011-03-21 17:18:42)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

Board footer

Powered by FluxBB