| View previous topic :: View next topic |
| Author |
Message |
Deebster Tux's lil' helper


Joined: 16 Nov 2003 Posts: 126 Location: Reading, England
|
Posted: Sat Jul 24, 2004 12:28 pm Post subject: Arguments against changing the root shell |
|
|
| 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. |
The theory is to keep your root setup as solid and simple as possible to minimise things that can break, so when your normal users don't work, you can go in as root and fix the problem.
If the problem is that a linked library of zsh is broken, then you won't be able to get in as root either.
Or if your /usr partition is misbehaving, /usr/ksh (or /usr/lib/*) won't be accesssible, and neither will root.
Another argument is why do you need ksh as your root shell? You shouldn't be spending enough time in there for it to matter.
However, seeing as gentoo puts all shells into /bin, as long as you haven't got anything too complicated and you compiled ksh statically, you shouldn't have to worry. |
|
| Back to top |
|
 |
kamagurka Veteran


Joined: 25 Jan 2004 Posts: 1026 Location: /germany/munich
|
Posted: Mon Jul 26, 2004 1:00 am Post subject: |
|
|
the only thing that bothers me a bit is that zsh's autocompletion doesn't seem to recognize new stuff. for example, when i emerge something new i have to call a new instance of zsh so autocompletion will know the new binary.
is there any option to make this a bit snappier (you know, like i'm used to with bash?) _________________ If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word |
|
| Back to top |
|
 |
Wi1d Apprentice


Joined: 15 Mar 2004 Posts: 282 Location: USA, Iowa
|
Posted: Mon Jul 26, 2004 1:30 am Post subject: |
|
|
| I hate that too. I've added: alias lzsh='source ~/.zshrc' to reload quickly after I've emerged a package. |
|
| Back to top |
|
 |
rav Tux's lil' helper


Joined: 24 Nov 2003 Posts: 114
|
Posted: Tue Jul 27, 2004 7:58 am Post subject: |
|
|
| kamagurka wrote: | the only thing that bothers me a bit is that zsh's autocompletion doesn't seem to recognize new stuff. for example, when i emerge something new i have to call a new instance of zsh so autocompletion will know the new binary.
is there any option to make this a bit snappier (you know, like i'm used to with bash?) |
type: rehash |
|
| Back to top |
|
 |
allucid Veteran

Joined: 02 Nov 2002 Posts: 1314 Location: atlanta
|
Posted: Tue Jul 27, 2004 8:23 am Post subject: |
|
|
| rav wrote: | | kamagurka wrote: | the only thing that bothers me a bit is that zsh's autocompletion doesn't seem to recognize new stuff. for example, when i emerge something new i have to call a new instance of zsh so autocompletion will know the new binary.
is there any option to make this a bit snappier (you know, like i'm used to with bash?) |
type: rehash |
Is there an elegant way handle this correctly (besides putting rehash in precmd()...)? |
|
| Back to top |
|
 |
rav Tux's lil' helper


Joined: 24 Nov 2003 Posts: 114
|
Posted: Tue Jul 27, 2004 9:14 am Post subject: |
|
|
| allucid wrote: | | Is there an elegant way handle this correctly (besides putting rehash in precmd()...)? |
AFAIK, no. If its just for after a emerge, might as well write a simple wrapper script which will run rehash after a emerge. Putting it in precmd, is probably a bit overkill.
Edit: Although I did find this, from a quick google.
| Quote: | } I find myself having to run "rehash" to get zsh to recognize the
} presence of a new executable in the PATH. bash doesn't seem to have that
} requirement. Is there an option to get that behavior in zsh?
You probably want "setopt nohashdirs". If that doesn't do it, "nohashcmds". |
ref: http://www.zsh.org/mla/users/2001/msg00038.html
Not entirely sure that disabling hashing is a good idea though. Nor have I tested if the aforementioned works. |
|
| Back to top |
|
 |
placeholder Advocate

Joined: 07 Feb 2004 Posts: 2500
|
Posted: Tue Jul 27, 2004 10:50 am Post subject: |
|
|
| I have some stuff about Zsh on my site under the Linux tips section. I'm not sure if that can be of help but if you think I should add something feel free to tell me. |
|
| Back to top |
|
 |
kamagurka Veteran


Joined: 25 Jan 2004 Posts: 1026 Location: /germany/munich
|
Posted: Tue Jul 27, 2004 12:00 pm Post subject: |
|
|
rehash works well enough for me. thanks! _________________ If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word |
|
| Back to top |
|
 |
placeholder Advocate

Joined: 07 Feb 2004 Posts: 2500
|
Posted: Tue Jul 27, 2004 12:27 pm Post subject: |
|
|
I get what this is all about now so I think I'm going to add it to my website.  |
|
| Back to top |
|
 |
allucid Veteran

Joined: 02 Nov 2002 Posts: 1314 Location: atlanta
|
Posted: Tue Jul 27, 2004 5:34 pm Post subject: |
|
|
| nohasdirs works for me. (I can't really tell what i'm missing by having it set...). |
|
| Back to top |
|
 |
redshift Tux's lil' helper

Joined: 26 Nov 2003 Posts: 98
|
Posted: Thu Jul 29, 2004 8:12 pm Post subject: |
|
|
Another convert. I'm loving the power.
@Laz-E-Coyote
| laz-e-coyote wrote: | I tried this and I get this error:
| Code: | | preexec:1: bad math expression: operand expected at `%{^[[0;31m%...' |
|
Zsh thinks a "[" is the start of a math expression. Try using instead. The only problem is that it might mess with your cursor position, but it's the only way I've found to get "[" and "]" working.
@Kamagurka
| kamagurka wrote: | +kamagurka@kumquad~/data3 (only black=white)
what i want is
kamagurka:~/data3 (black still = white) |
Try changing the PROMPT line in your .zshrc to the following:
| Code: | PROMPT='$PR_SET_CHARSET\
$BLACK$PR_SHIFT_IN$PR_ULCORNER$BLUE$PR_HBAR$PR_SHIFT_OUT(\
$GREEN%n$MCOLOR:%$PR_PWDLEN<...<%~%<<\
$BLUE)$PR_SHIFT_IN$PR_HBAR$BLACK$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$BLUE$PR_HBAR$PR_SHIFT_OUT(\
$WHITE%D{%H:%M}\
$BLUE)$PR_SHIFT_IN$PR_HBAR$BLACK$PR_URCORNER$PR_SHIFT_OUT\
$PR_SHIFT_IN$PR_LLCORNER$BLUE$PR_HBAR$PR_SHIFT_OUT%(!.#.$)$DEF ' |
_________________ Tom |
|
| Back to top |
|
 |
True Tux's lil' helper


Joined: 10 Apr 2002 Posts: 125 Location: Vancouver
|
Posted: Fri Jul 30, 2004 12:20 am Post subject: |
|
|
shm wrote:
| Quote: | | I used zsh for a long time back when bash didn't have programmable completetion. Well, it does now, and it's almost as advanced as zsh's. Zsh does have other advantages however: a lot of it's syntax is a lot simplier than bash's. For example, to unzip some files, you can just do for x in *.zip; unzip $x. (if I recall right) |
Cool!
for i in *.mp3; mpg123 $i
This ability to handle spaces in filenames rocks. It should make scripting a lot easier. |
|
| Back to top |
|
 |
KozmoNaut Apprentice


Joined: 09 Dec 2002 Posts: 168 Location: Denmark
|
Posted: Fri Jul 30, 2004 9:54 am Post subject: |
|
|
I have also recently converted to Zsh. It just 'feels' better than Bash, somehow.
And I have to thank slartiJ for his brilliant .zshrc. It rocks.
EDIT: I did find one thing missing, though:
The ability to use shift+tab for moving backwards through those nifty auto-completion menus.
This fixes it:
| Code: | | bindkey "\e[Z" reverse-menu-complete |
I can only get it to work with the left shift key, though...
EDIT2: It works now, with "^[[Z" instead of "\e[Z"... _________________ War. War never changes. |
|
| Back to top |
|
 |
karnesky Apprentice

Joined: 18 Mar 2004 Posts: 218
|
Posted: Tue Aug 03, 2004 4:10 pm Post subject: |
|
|
Month old problem--you've probably already fixed it & partial fix suggestions are in this thread:
| sabo wrote: | | One of the things you can do (not sure if it works in your cases, I forget One problem I have is whenever I hit delete, home, end, or anything in that area it capitalizes the letters and screws up the command. | Here's what I use: | Code: | bindkey '^[[7~' vi-beginning-of-line # Home
bindkey '^[[8~' vi-end-of-line # End of Line
bindkey '^[[2~' beep # Insert
bindkey '^[[3~' delete-char # Del
bindkey '^[[5~' vi-backward-blank-word # Page Up
bindkey '^[[6~' vi-forward-blank-word # Page Down
|
|
|
| Back to top |
|
 |
nathanj n00b


Joined: 03 Nov 2003 Posts: 46 Location: Perth, WA, Australia
|
Posted: Tue Aug 10, 2004 5:16 am Post subject: |
|
|
Thanks slarti for converting me! It rocks! _________________ nathan |
|
| Back to top |
|
 |
KozmoNaut Apprentice


Joined: 09 Dec 2002 Posts: 168 Location: Denmark
|
Posted: Tue Aug 10, 2004 7:11 am Post subject: |
|
|
A function that works like ctrl+r (history search) would be nice.
This works, but is cumbersome:
| Code: | % history 1- | grep 'command'
% r 'number_of_command' |
_________________ War. War never changes. |
|
| Back to top |
|
 |
oberyno Guru

Joined: 15 Feb 2004 Posts: 467 Location: /bin/zsh
|
Posted: Tue Aug 10, 2004 7:24 am Post subject: |
|
|
| KozmoNaut wrote: | | A function that works like ctrl+r (history search) would be nice. | If you want all the emac bindings you can put this in your .zshrc: |
|
| Back to top |
|
 |
Jeremy_Z l33t


Joined: 05 Apr 2004 Posts: 671 Location: Shanghai
|
Posted: Tue Aug 10, 2004 9:50 am Post subject: |
|
|
Looks like something i have to try. I will try some of your config, zsh is like fvwm, with a good one, it rocks. _________________ "Because two groups of consumers drive the absolute high end of home computing: the gamers and the porn surfers." /.
My gentoo projects, Kelogviewer and a QT4 gui for etc-proposals |
|
| Back to top |
|
 |
KozmoNaut Apprentice


Joined: 09 Dec 2002 Posts: 168 Location: Denmark
|
Posted: Tue Aug 10, 2004 12:23 pm Post subject: |
|
|
| Jeremy_Z wrote: | | Looks like something i have to try. I will try some of your config, zsh is like fvwm, with a good one, it rocks. |
Exactly!
I'm using Xfce4 at the moment, but I'm thinking about going back to FVWM. Xfce's overall level of nice-ness keeps me from doing it, though. _________________ War. War never changes. |
|
| Back to top |
|
 |
Jeremy_Z l33t


Joined: 05 Apr 2004 Posts: 671 Location: Shanghai
|
Posted: Sun Aug 15, 2004 4:46 pm Post subject: |
|
|
I tried zsh with raoul config (another Epita student ). It is all nice but some binding don't work :
for example :
ctrl+A works
ctrl+Q does not ..
 _________________ "Because two groups of consumers drive the absolute high end of home computing: the gamers and the porn surfers." /.
My gentoo projects, Kelogviewer and a QT4 gui for etc-proposals |
|
| Back to top |
|
 |
tln Veteran

Joined: 24 Sep 2003 Posts: 1502
|
Posted: Sun Aug 15, 2004 6:40 pm Post subject: |
|
|
What is the easiest way to get a color prompt? Up until now, I've been using print() to get the color escape sequences into the prompt.
| Code: | | PS1="$(print '%{\e[1;32m%}%n@%m%{\e[0m%}')... |
|
|
| Back to top |
|
 |
Jeremy_Z l33t


Joined: 05 Apr 2004 Posts: 671 Location: Shanghai
|
Posted: Sun Aug 15, 2004 6:59 pm Post subject: |
|
|
I don't have PS1 but
| Code: |
PROMPT='$PR_SET_CHARSET\
$BLACK$PR_SHIFT_IN$PR_ULCORNER$BLUE$PR_HBAR$PR_SHIFT_OUT(\
$MCOLOR+$WHITE%n$MCOLOR@$WHITE%m$MCOLOR%$PR_PWDLEN<...<%~%<<\
$BLUE)$PR_SHIFT_IN$PR_HBAR$BLACK$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$BLUE$PR_HBAR$PR_SHIFT_OUT(\
$WHITE%D{%H:%M}\
$BLUE)$PR_SHIFT_IN$PR_HBAR$BLACK$PR_URCORNER$PR_SHIFT_OUT\
$PR_SHIFT_IN$PR_LLCORNER$BLUE$PR_HBAR$PR_SHIFT_OUT%(!.#.$)$DEF '
RPROMPT=' $BLACK$PR_SHIFT_IN$PR_HBAR$BLUE$PR_HBAR$PR_SHIFT_OUT\
($MCOLOR%(?,$GREEN\\o/,$RED\\o_ $WHITE%139(?,Seg fault,\
%130(?,Interrupt,%138(?,Bus Error,%?)))$RED _o/)\
$BLUE)$PR_SHIFT_IN$PR_HBAR$BLACK$PR_LRCORNER$PR_SHIFT_OUT$DEF'
SPROMPT='zsh: correct $MCOLOR%R$DEF to $MCOLOR%r$DEF%b ? ([${MCOLOR}Y$DEF]es/\
[${MCOLOR}N$DEF]o/[${MCOLOR}E$DEF]dit/[${MCOLOR}A$DEF]bort) '
|
_________________ "Because two groups of consumers drive the absolute high end of home computing: the gamers and the porn surfers." /.
My gentoo projects, Kelogviewer and a QT4 gui for etc-proposals |
|
| Back to top |
|
 |
oberyno Guru

Joined: 15 Feb 2004 Posts: 467 Location: /bin/zsh
|
Posted: Sun Aug 15, 2004 11:14 pm Post subject: |
|
|
Hey all you zshers. There's some new completions in portage with the latest ~arch zsh. The list: gcc-config, quickpkg, gensync, equery, and qpkg and an updated emerge.
Equery needs to have --quiet and --nocolor before the action if you want to complete those.
Qpkg defaults to pkgnames, but make sure you supply an option before or after the package. Default qpkg behavior (qpkg zsh) is quite useless in my opinion, as it only returns app-shells/zsh *.
Emerge now has =,<,>,>=,<= support. You will need to escape the operators though. | Code: | oberyno> emerge -p \=zsh-4. ~
---- portage
zsh-4.0.9-r3 zsh-4.1.1-r5 zsh-4.2.0-r1 zsh-4.2.1_alpha1
zsh-4.1.1-r4 zsh-4.2.0 zsh-4.2.1 |
This completes all ebuilds similar to the default zsh emerge behavior. As it completes all ebuilds, you don't want to do emerge \=<tab> as there are ~15000 ebuilds and it will take a while. That being said, emerge \=g<tab> or similar is speedy. By all means if you mean to use this feature, make sure you enable cache support in your .zshrc. | Code: | zstyle ':completion::complete:*' use-cache 1
| All the sample configs I've seen floating around here have that already. Technically, you don't need the cache, but it will be really slow. The cache is set to reset itself once a week at the moment, but no amount of time is really ideal. What would be ideal is making an alias like this in your .zshrc: | Code: | alias zsync="rm /home/user/.zcache/portage_ebuilds && rm ~/.zcache/portage_ebuilds && emerge sync"
| where .zcache is your cache directory. Of course, thats all assuming you actually want to emerge specific ebuilds. BTW, esearch has the same cache problem and it gets around the problem with the wrapper script esync. Feel free to replace emerge sync in the above example with it.
Genlop has --date support. Here's a screenshot of it. The first tab completion is time sensitive, i.e., it won't complete december when it's august or friday when it's monday. I didn't do this for all possible combinations, because it increases the size of the completion too much. So 3rd saturday <tab> completes all months. Also, specifying a number first works. | Code: | oberyno> genlop --date 24 ~
days ago months ago weeks ago years ago |
Gensync, gcc-config and quickpkg should be perfect.
Anyway, if anyone encounters a bug, please pm me. Enjoy. |
|
| Back to top |
|
 |
geniux Veteran


Joined: 19 Feb 2004 Posts: 1400 Location: /home
|
Posted: Fri Sep 03, 2004 11:16 pm Post subject: |
|
|
I've seen that alot of you got the % after the username, but I've still got the $. Anyone know how to change this, would be nice to show that I have zsh  _________________ AMD Athlon64 X2 4200+ AM2
MSI K9N SLI Platinum, Enermax Liberty 500W
1GB RAM Crucial DDR2 667MHz, MSI nVidia 7600GS 256MB
400GB + 250GB Samsung SATAII HDD
Gentoo - BeyondSources 2.6.19-20 |
|
| Back to top |
|
 |
r0nin Tux's lil' helper


Joined: 26 Aug 2004 Posts: 140 Location: San Diego
|
Posted: Sat Sep 04, 2004 12:14 am Post subject: |
|
|
From the looks of things everyone seems to like zsh. I will emerge it tonight and play around with it. _________________ Registered linux user #366586
--New California Gentoo Linux User Group site up (CAGLUG) |
|
| Back to top |
|
 |
|