You are not logged in.
I have to manually source my ~/.zshrc to make my up and down arrow keys work when I am searching through commands in my history from a tty outside of X. Keys work as expected from a shell in X. Something else I noticed when logging in from the tty outside of X is that it drops me to / not to ~ which is also weird.
I am using grayskys .zsh configs so maybe he will help.
Last edited by maggie (2013-01-26 11:25:01)
Offline
This only happens when I am in a tty outside of X. I can't find a solution to this
Offline
It would probably be more helpful if you pastebinned your configs for .zsh, including .zshenv, .zprofile (or however you initilaize your session), and some details about your environment.
History works fine for me in TTY using the cursor arrows.
Offline
Actually, what Maggie described is true on my system as well. You can see the configs at my github link in my sig.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I have only just started using zsh, so I am not particularly familiar with it, but in your github repo your keys file doesn't include the arrow keys, so I am not sure how they work in X, unless your WM handles that. In my .zshrc, I have:
# keybinds
bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward
as per the wiki and those keys work in X and TTY.
Offline
https://github.com/graysky2/configs/blo … b/keys.zsh
First few lines... Have to try your suggestion tomorrow.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
OK... if I ctrl+alt+F1 then log in my up/down arrow keys work BUT they do not work using history completion. In other words, I hit up arrow, it will scroll through my history but if I start typing a command and then hit up arrow, it does not honor what I typed and search within the subset. If I manually source my ~/.zshrc and try it, it does work as expected.
EDIT: http://www.zsh.org/mla/users/2013/msg00001.html
Last edited by graysky (2013-01-01 11:32:23)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
It would probably be more helpful if you pastebinned your configs for .zsh, including .zshenv, .zprofile (or however you initialize your session), and some details about your environment.
Offline
@jw - Missed that.... I used `chsh -s $(which zsh)` which modded /etc/passwd for my user:
facade:x:1001:100::/home/facade:/bin/zsh
...naive question but is that how am I initializing my session?
Last edited by graysky (2013-01-01 20:32:51)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
How do you login? I looked through your configs, but I didn't find* a .zprofile or the like that sets up your environment.
* I am between Internet connections at the moment and can only tether to my phone's rather dire 3G network, so opening a heap of pages is a RPITA, ie., I may have missed it...
Offline
Login is simply via ctrl+alt+Fx and type name/password for non X or via lxdm with X. Can you post your ~/.zprofile for me?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Sure: relevant files here: http://sprunge.us/IPTQ
For non-X, something has to start your session.
Offline
For non-X, something has to start your session.
What's the Arch default? For example, without X installed, the system is at the multiuser target... what starts sessions?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
/etc/profile
Did you try adding those keybinds to your rc file?
Offline
@jason - No, because they work just fine under X. I think your original suspicion about a sourcing problem is more likely. Plus, aren't those emacs bindings? I use vim bindings. The sole line in /etc/zsh/zprofile is:
emulate sh -c 'source /etc/profile'
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
The bindings working under X may be LXDE-related (check in your rc.xml).
Yes, they are emacs bindings because vim doesn't use the cursor keys, but that is the behaviour you are seeking, so you could try and see if it works.
Offline
@jason - I pasted your ~/.zprofile to my ~ and tried it out from the TTY... no change
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
OK: I am out of ideas.
I just tried a new keybinding in my .zshrc and it worked flawlessly in the TTY. Try is and see what happens:
bindkey "\ek" backward-kill-line
Switch to a TTY and type a string then hit Alt-k and see if it deletes it.
Offline
@j - Yes, it does indeed kill the line... are we talking about the same thing here... the arrow keys work from the TTY, they just do not work as they do under X with history completion... example:
Under X I type: cd <space> <up arrow>
I get:
cd logs
cd ~
cd /boot
Under a TTY I do the same and the three characters I typed "cd " have no effect and up arrow gives me just a blind list of my last commands. EXCEPT after I manually source my ~/.zshrc at which point the up arrow behaves as it did under X.
Last edited by graysky (2013-01-02 04:50:43)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
@graysky - Does it make any difference if you source your .zshrc from your .zprofile file?
Offline
@graysky If you logged into a new TTY, and the new bind worked, then your .zshrc is being correctly sourced.
@anonymous_user that shouldn't be necessary (but it might not hurt as a hack).
My suspicion is that it is still the way you have defined the keys (although that doesn't account for how they work as expected once you source the file from the TTY). In any event, as you won't test my hypothesis, the point is moot.
Offline
@graysky If you logged into a new TTY, and the new bind worked, then your .zshrc is being correctly sourced.
My suspicion is that it is still the way you have defined the keys (although that doesn't account for how they work as expected once you source the file from the TTY). In any event, as you won't test my hypothesis, the point is moot.
Thought I did?
@jason - I pasted your ~/.zprofile to my ~ and tried it out from the TTY... no change
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
No, I meant the keybinds I pasted right at the start f this thread. Remove everything else from your keys fle and just start with those (that is what I did). I currently only have this key-related stuff in my .zshrc:
# keybinds
bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward
bindkey "\ep" insert-last-word
bindkey "\eq" quote-line
bindkey "\ek" backward-kill-line
# use the vi navigation keys in menu completion
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
Offline
OK... I replaced my ~/.zshrc with your code:
/home/facade/.zshrc:bindkey:9: no such keymap `menuselect'
/home/facade/.zshrc:bindkey:10: no such keymap `menuselect'
/home/facade/.zshrc:bindkey:11: no such keymap `menuselect'
/home/facade/.zshrc:bindkey:12: no such keymap `menuselect'
ease%
No arrow key functionality at all
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Remove the second stanza, the vi navigation keys, and see what happens...
Offline