Steev’s Gentoo Stuff

July 10, 2006

Please help…

Filed under: Gentoo — steev @ 2:49 am

So, thanks to a local LUG member, I have a “new” Dell Inspiron 8100.  I had to buy a new motherboard for it though - and it is a C800 motherboard.  The shell and keyboard however are fromt he 8100.  This thing is awesome… But I have one major problem… zsh.

I simply cannot get zsh to work properly with it.  Actually everything works spectacularly, except for the home and end keys.  And it is different between terminals.  xterm is the only one that works perfectly.

http://pastebin.ca/83446

That is the output when I hit home/end in mrxvt, xterm, and gnome-terminal.  As previously mentioned, only xterm works properly when I hit home/end.

http://dev.gentoo.org/~steev/files/screenshots/homend.png

This is a screenshot of hitting home/end in gnome-terminal.

Any help getting this working is greatly appreciated - the zshrc file I use, can be found at

http://dev.gentoo.org/~steev/files/zshrc

6 Comments »

  1. If I got you right you have trouble with defining the home/end keys in different terminals.
    I’ve done it in a short with a little case-statement:

    bindkey -e

    bindkey “^[q" push-line-or-edit ### -
    bindkey "^[[3~" delete-char ###
    bindkey "^[[5~" history-beginning-search-backward ###
    bindkey "^[[6~" history-beginning-search-forward ###
    case $TERM in
    Eterm)
    bindkey "^[[7~" beginning-of-line ###
    bindkey "^[[8~" end-of-line ###
    ;;
    xterm)
    bindkey "^[[H" beginning-of-line ###
    bindkey "^[[F" end-of-line ###
    ;;
    linux)
    bindkey "^[[1~" beginning-of-line ###
    bindkey "^[[4~" end-of-line ###
    ;;
    screen)
    if [ $ETERM_THEME_ROOT ]
    then
    bindkey “^[[7~” beginning-of-line ###
    bindkey “^[[8~” end-of-line ###
    else
    bindkey “^[[1~” beginning-of-line ###
    bindkey “^[[4~” end-of-line ###
    fi
    ;;
    esac

    Maybe this will help.

    Comment by Markus R. — July 10, 2006 @ 5:06 am

  2. That is a big part of it - however, the other part is that all vte based terminals fail no matter what I try to pass to bindkey - that is/was my main issue

    Comment by steev — July 10, 2006 @ 5:14 am

  3. I have 3 bindings for home and end (and I don’t use case/esac anymore) :

    bindkey ‘^[[1~’ beginning-of-line # Home (console)
    bindkey ‘^[[4~’ end-of-line # End (console)
    bindkey ‘^[OH’ beginning-of-line # Home (gnome-terminal)
    bindkey ‘^[OF’ end-of-line # End (gnome-terminal)
    bindkey ‘^[[H’ beginning-of-line # Home (konsole+xterm)
    bindkey ‘^[[F’ end-of-line # End (konsole+xterm)

    it works well for me :)

    Comment by tuXXX — July 10, 2006 @ 11:45 am

  4. Thank you to both Markus and tuXXX - adding in what tuXXX had has fixed it - although I had to add

    bindkey ‘^[[7~’ beginning-of-line # Home (Eterm)
    bindkey ‘^[[8~’ end-of-line # End (Eterm)

    As well - now console, Eterm, mrxvt, gnome-terminal, tilda, xterm, and uxterm all work now :) And I can get back to focusing on things I really need to, on a machine I can actually use!

    Comment by steev — July 10, 2006 @ 12:43 pm

  5. Another thing you can use is zkbd, which is a zsh script which asks you to press the different keys which most commonly are problematic, and stores the “symbols” from those keypresses in a script under ~/.zkbd for sourcing by your .zshrc.

    so, you run “zsh /usr/share/zsh//functions/Misc/zkbd” and then place something like this in your .zshrc

    if [ -f $HOME/.zkbd/$TERM-pc-linux-gnu ]; then
    source $HOME/.zkbd/$TERM-pc-linux-gnu
    fi
    [[ -n ${key[Home]} ]] && bindkey “${key[Home]}” beginning-of-line
    [[ -n ${key[End]} ]] && bindkey “${key[End]}” end-of-line

    Comment by Patrick Börjesson — July 12, 2006 @ 3:04 am

  6. Hello

    Great book. I just want to say what a fantastic thing you are doing! Good luck!

    Bye

    Comment by tovorinok — July 5, 2007 @ 12:25 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.