Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ZSH users (lovers?) thread
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, ... 11, 12, 13  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
blue.sca
l33t
l33t


Joined: 28 Aug 2003
Posts: 680
Location: Mainz, Germany

PostPosted: Wed Jun 23, 2004 4:40 pm    Post subject: Reply with quote

2 little questions.
where do i set this as my default shell? /etc/passwd ?!?
and, i've seen this as a comment in a .zshrc of a developer, why shouldn't i use zsh for root?
_________________
geek by nature, linux by choice
i want my avatar back... thank you
:wq
Back to top
View user's profile Send private message
Stormy Eyes
Veteran
Veteran


Joined: 09 Apr 2003
Posts: 1064
Location: Watching God spit-shine my boots.

PostPosted: Wed Jun 23, 2004 4:45 pm    Post subject: Reply with quote

blue.sca wrote:
2 little questions.
where do i set this as my default shell? /etc/passwd ?!?
and, i've seen this as a comment in a .zshrc of a developer, why shouldn't i use zsh for root?


You can use the usermod command as root to change a user's shell. Refer to the man page.
Back to top
View user's profile Send private message
Stormy Eyes
Veteran
Veteran


Joined: 09 Apr 2003
Posts: 1064
Location: Watching God spit-shine my boots.

PostPosted: Wed Jun 23, 2004 4:46 pm    Post subject: Reply with quote

Raoul, thanks for posting a link to your config. I'm using zsh now and I'm a very happy kitty.
Back to top
View user's profile Send private message
placeholder
Advocate
Advocate


Joined: 07 Feb 2004
Posts: 2500

PostPosted: Wed Jun 23, 2004 4:59 pm    Post subject: Reply with quote

The usermod command for that would be as follows.

Code:
usermod -s /bin/zsh username


It's a good thing when us kitties are happy. Then we don't kill people as often with our dangerous fangs and claws. :lol:
Back to top
View user's profile Send private message
supernovus
Apprentice
Apprentice


Joined: 13 Jul 2003
Posts: 150
Location: inside my head

PostPosted: Wed Jun 23, 2004 5:48 pm    Post subject: Reply with quote

I tried zsh a while back, and am now back trying it again. I'm going to hack away at some of those posted zshrc files and see what I come up with :-)

Thanks for renewing my interest in this great shell, and posting some very nice rc files!
_________________
Remove OTW
Back to top
View user's profile Send private message
apeitheo
Apprentice
Apprentice


Joined: 09 Jan 2004
Posts: 222
Location: Pennsylvania, United States

PostPosted: Wed Jun 23, 2004 7:11 pm    Post subject: Reply with quote

I'm trying to customize my prompt/rprompt, and I can't seem to figure out how to get colors?
Could someone just give me an example of how to get a color, lets say make this red:
RPROMPT="[%T]"
I've been trying a few things, but with no avail, maybe someone can help?

EDIT: Nevermind :wink: I got it now, This is great


Last edited by apeitheo on Wed Jun 23, 2004 8:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
Tii
l33t
l33t


Joined: 02 Jan 2004
Posts: 733

PostPosted: Wed Jun 23, 2004 8:26 pm    Post subject: Reply with quote

When I get my machine finally up I'll give it a spin. Based on what I'm reading here it might be something that suits me.
Back to top
View user's profile Send private message
Dolio
l33t
l33t


Joined: 17 Jun 2002
Posts: 650

PostPosted: Thu Jun 24, 2004 3:19 am    Post subject: Reply with quote

For red:

RPROMPT="[%{$fg_bold[red]%}%T%{$reset_color%}]"

The %{ %} around the coloring statements apparently tells the line reader to ignore it, so that it can correctly display lines when you edit them (which might have been a problem I had back in bash, where long lines would get garbled when I edited them).

I think there's also $fg[...] $bg[...] and $bg_bold[...].

I must say, this is much nicer than in bash, where I had to write out all the ASCII escape code variables for myself. :) I think I'm converted.
_________________
They don't have a good bathroom to do coke in.
Back to top
View user's profile Send private message
triangle289
n00b
n00b


Joined: 24 Jun 2004
Posts: 6

PostPosted: Thu Jun 24, 2004 3:22 am    Post subject: Reply with quote

I think zsh looks very cool but the advanced tab auto complete stuff looks a little different. I'll try it! :)
Back to top
View user's profile Send private message
NME
Apprentice
Apprentice


Joined: 18 Nov 2003
Posts: 168
Location: The Netherlands

PostPosted: Thu Jun 24, 2004 12:24 pm    Post subject: Reply with quote

Unfortunately when i run zsh from a bash prompt it cant find all kinds of modules, i copied the zshrc to ~/.zshrc

am i stupid?
what should i do about this?
_________________
f# that.
Back to top
View user's profile Send private message
apeitheo
Apprentice
Apprentice


Joined: 09 Jan 2004
Posts: 222
Location: Pennsylvania, United States

PostPosted: Thu Jun 24, 2004 3:00 pm    Post subject: Reply with quote

NME wrote:
Unfortunately when i run zsh from a bash prompt it cant find all kinds of modules, i copied the zshrc to ~/.zshrc

am i stupid?
what should i do about this?


You copied /usr/share/doc/zsh-4.2.0-r1/StartupFiles/zshrc.gz to ~/.zshrc?
Open up your ~/.zshrc file and comment out these lines(excluding the top line, since its already commented out, just there to help you find it):
Code:

# Autoload zsh modules when they are referenced
zmodload -a zsh/stat stat
zmodload -a zsh/zpty zpty
zmodload -a zsh/zprof zprof
zmodload -ap zsh/mapfile mapfile

That should probably do it, I hope.
Technically you weren't really supposed to do that without editing it, as in the file it says:
# THIS FILE IS NOT INTENDED TO BE USED AS /etc/zshrc, NOR WITHOUT EDITING
Also I see this, that you might not have removed:
return 0 # Remove this line after editing this file as appropriate

Good luck :wink:
Back to top
View user's profile Send private message
phranzee
Guru
Guru


Joined: 22 Nov 2003
Posts: 397
Location: katowice/pl

PostPosted: Thu Jun 24, 2004 7:05 pm    Post subject: Reply with quote

(imo) nice zsh prompt 'tutorial' :arrow: here :)
_________________
signature fault
post dumped ;]
Back to top
View user's profile Send private message
Tyir
Apprentice
Apprentice


Joined: 08 Mar 2004
Posts: 172
Location: Montreal

PostPosted: Thu Jun 24, 2004 11:31 pm    Post subject: Reply with quote

hey iv been using zsh because of this thread, and im loving it

a question:
bindkey '^X^H' run-help
that was an example keybinding in a guide..

is this Control-X, Control-H, emacs-style?

becuase it doesnt seem to be working...
_________________
There are two things I have learnt in life:
1. Don't reveal everything you know.
Back to top
View user's profile Send private message
Abraxas
l33t
l33t


Joined: 25 May 2003
Posts: 793

PostPosted: Thu Jun 24, 2004 11:44 pm    Post subject: Reply with quote

I do have a question about zsh. I still haven't been able to get my del, home, or end keys to work. I have this in my .zshrc but it doesn't do anything:

Code:
case $TERM in (xterm*|aterm|rxvt)
   bindkey "\e[1~" beginning-of-line
   bindkey "\e[2~" transpose-words
   bindkey "\e[3~" delete-char
   bindkey "\e[4~" end-of-line ;;
esac


I know those are the right keys too. Anyone have a fix for this behaviour?
_________________
Time makes more converts than reason. - Thomas Paine
Back to top
View user's profile Send private message
minhtang
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2003
Posts: 76

PostPosted: Thu Jun 24, 2004 11:47 pm    Post subject: Reply with quote

Quote:

hey iv been using zsh because of this thread, and im loving it

a question:
bindkey '^X^H' run-help
that was an example keybinding in a guide..

is this Control-X, Control-H, emacs-style?

becuase it doesnt seem to be working...


Are you sure it's ^X^H ? On my system it's ^]H (Escape-H). You can execute bindkeys to see the list of keys binding.

Quote:

I do have a question about zsh. I still haven't been able to get my del, home, or end keys to work. I have this in my .zshrc but it doesn't do anything:

Code:
case $TERM in (xterm*|aterm|rxvt)
bindkey "\e[1~" beginning-of-line
bindkey "\e[2~" transpose-words
bindkey "\e[3~" delete-char
bindkey "\e[4~" end-of-line ;;
esac

I know those are the right keys too. Anyone have a fix for this behaviour


Well, are you sure Home is '\e[1~' ? The best way to check the code for Home is to do C-v and then press Home to see the correct code. On my machine, Home is mapped to "^[[H", and using bindkey "^[[H" beginning-of-line works while bindkey '\e[1~' doesn't. And, do you really need the case statement ? I may not get it, but I don't think you will need to use case in this situation.
_________________
Three minutes of thought would suffice to find this out. But then, thought is irksome, and three minutes is a rather long time.
-- A.E. Houseman
Back to top
View user's profile Send private message
dru
n00b
n00b


Joined: 22 Apr 2004
Posts: 54
Location: use strict;

PostPosted: Fri Jun 25, 2004 2:06 am    Post subject: Reply with quote

Another convert. You didn't mention this in your original post, but here's something I picked up at your website that I thought was really cool:

Code:

Say I type in cd /u/s/z/4(tab), ZSH will expand those letters into a full blown path (/usr/share/zsh/4.2.0 in this case). This comes in very very handy, and, in my opinion, it is quicker than using tab-completition on full directory names each time, in the way you are used to if you use Bash's directory tabbing.

_________________
Thanks,
Dru
Back to top
View user's profile Send private message
Tyir
Apprentice
Apprentice


Joined: 08 Mar 2004
Posts: 172
Location: Montreal

PostPosted: Fri Jun 25, 2004 5:27 am    Post subject: Reply with quote

thanks minhtang

another question, is there a way to get the history program working with zsh?

it seems to only get the last 15 or so items, even thought the .zhistory file has alot more...
_________________
There are two things I have learnt in life:
1. Don't reveal everything you know.
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Fri Jun 25, 2004 11:30 am    Post subject: Reply with quote

another question :)

Is anyone using zsh for their root shell? My paths don't get set correctly and dircolors complains about not having the SHELL variable set. I can set the shell variable in my .zshrc as a workaround but I don't know what paths I should set for root.
Back to top
View user's profile Send private message
laz-e-coyote
n00b
n00b


Joined: 25 Jun 2004
Posts: 6

PostPosted: Fri Jun 25, 2004 1:00 pm    Post subject: awsom! Reply with quote

Zsh is amazing, the autocomplete is absolutely incredible
and a smart autocomplete, if i do "cd<tab>" it will only show me directories (or symlinks to directories)

I added a function to .zshrc (found something similiar to it on the net) that allows me to copy/paste using X's clipboard (either selection or clipboard buffers, i use the xclip program for it):

Code:


copy-to-clipboard ()
{
  if [ -n "$LBUFFER$RBUFFER" ]; then
    echo $LBUFFER$RBUFFER | xclip -i
  fi
}

paste-from-clipboard ()
{
  CLIPOUT=`xclip -o`
  BUFFER=$LBUFFER$CLIPOUT$RBUFFER
}

zle -N paste-from-clipboard paste-from-clipboard
zle -N copy-to-clipboard copy-to-clipboard
bindkey "^V" paste-from-clipboard
bindkey "^Y" copy-to-clipboard



This is very comfortable, since when the mouse is out of the terminal window area, shift+insert doesn't work (i'm a keyboard freak).
Back to top
View user's profile Send private message
Tyir
Apprentice
Apprentice


Joined: 08 Mar 2004
Posts: 172
Location: Montreal

PostPosted: Fri Jun 25, 2004 4:56 pm    Post subject: Reply with quote

ok, another question/problem iv had since I switched to Z

i have a script for my music player:

in which a line is this:
rxvt -bg black -fg white -e bash -c "mpc listall|grep --colour=always $1|less"
it opens a term, which has a less of a grepped list
I really want it to be in colour, and it was fine before, but now when I run it it shows up like this:
Weezer/Weezer_-_In_The_GaESC[01;31mrageESC[00m.mp3
if i was searching for 'rage'

i (as root) used usermod to switch back to bash, relogged in, and it worked fine.
And ideas why having zsh as my default screws with the colours for grep?


EDIT : the friendly guys at #zsh helped me out
i needed to add the -r flag to less
_________________
There are two things I have learnt in life:
1. Don't reveal everything you know.


Last edited by Tyir on Fri Jun 25, 2004 7:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Fri Jun 25, 2004 5:22 pm    Post subject: Reply with quote

allucid wrote:
another question :)

Is anyone using zsh for their root shell? My paths don't get set correctly and dircolors complains about not having the SHELL variable set. I can set the shell variable in my .zshrc as a workaround but I don't know what paths I should set for root.

nevermind, i forgot to pull some stuff out of /etc/profile
Back to top
View user's profile Send private message
dru
n00b
n00b


Joined: 22 Apr 2004
Posts: 54
Location: use strict;

PostPosted: Fri Jun 25, 2004 7:08 pm    Post subject: Reply with quote

So switching your root shell to zsh shouldn't cause any problems? I remember reading on a Solaris forum (I think) you should never switch root's shell. I just want to make sure it's cool before hosing my system.
_________________
Thanks,
Dru
Back to top
View user's profile Send private message
apeitheo
Apprentice
Apprentice


Joined: 09 Jan 2004
Posts: 222
Location: Pennsylvania, United States

PostPosted: Fri Jun 25, 2004 9:16 pm    Post subject: Reply with quote

dru wrote:
So switching your root shell to zsh shouldn't cause any problems? I remember reading on a Solaris forum (I think) you should never switch root's shell. I just want to make sure it's cool before hosing my system.


I changed my root's shell to zsh 2+ days ago, and I've had no problems, so you should be alright :D
Back to top
View user's profile Send private message
monkey89
Guru
Guru


Joined: 08 Mar 2004
Posts: 596

PostPosted: Sat Jun 26, 2004 2:39 pm    Post subject: Reply with quote

I must admit, I really like zsh and am using it for my primary user's shell (but not for root). Though there isn't much modified, here is my .zshrc:

http://linux.monkzone.net/monkey.zshrc

(The main linux.monkzone.net is outdated, I'm gonna fix it up soon and make it a general linux page with all my info and stuff)

I also want to know if someone could perhaps get genlop auto completion working... Here's the bash completion script that comes with it for reference:

http://linux.monkzone.net/genlop

Thanks! :)
Back to top
View user's profile Send private message
Abraxas
l33t
l33t


Joined: 25 May 2003
Posts: 793

PostPosted: Sun Jun 27, 2004 3:21 am    Post subject: Reply with quote

minhtang wrote:
Quote:

hey iv been using zsh because of this thread, and im loving it

a question:
bindkey '^X^H' run-help
that was an example keybinding in a guide..

is this Control-X, Control-H, emacs-style?

becuase it doesnt seem to be working...


Are you sure it's ^X^H ? On my system it's ^]H (Escape-H). You can execute bindkeys to see the list of keys binding.

Quote:


As for I do have a question about zsh. I still haven't been able to get my del, home, or end keys to work. I have this in my .zshrc but it doesn't do anything:

Code:
case $TERM in (xterm*|aterm|rxvt)
bindkey "\e[1~" beginning-of-line
bindkey "\e[2~" transpose-words
bindkey "\e[3~" delete-char
bindkey "\e[4~" end-of-line ;;
esac

I know those are the right keys too. Anyone have a fix for this behaviour


Well, are you sure Home is '\e[1~' ? The best way to check the code for Home is to do C-v and then press Home to see the correct code. On my machine, Home is mapped to "^[[H", and using bindkey "^[[H" beginning-of-line works while bindkey '\e[1~' doesn't. And, do you really need the case statement ? I may not get it, but I don't think you will need to use case in this situation.


To be honest I haven't messed with the .zshrc file in a long time. Doing what you said, I end up with completely different character than you said and than what I had in the file. I just remember doing that before and those were the characters that came up. It may have to do with a different keyboard layout than I was using before. I rebuilt my system recently I may have picked different options. As for the case statement, I think it was there from the .zshrc that I started from and I just never changed it.

Well it's time to see if these new characters work.
_________________
Time makes more converts than reason. - Thomas Paine
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3, ... 11, 12, 13  Next
Page 2 of 13

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum