You are not logged in.

#26 2005-12-20 19:11:48

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: A new shell?

shadowhand wrote:

There are a lot of subtle differences between zsh and bash that make zsh much more powerful to use, but you have to use it to see the difference. (zsh has better prompt support. Nerd points +100.)

Here's the biggest problem as far as scripting goes:

let's assume we have a function named 'foo' that takes two parameters and echos them like "param1 = param2"

bash:
   foo a b
   # a = b
   foo "a b"
   # a = b
zsh:
   foo a b
   # a = b
   foo "a b"
   # a b =

bash breaks strings based on IFS, zsh does not - it's not a *big deal* but it causes alot of little snippets to fail

Offline

#27 2005-12-21 09:53:01

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: A new shell?

I wouldnt be surprised if there were a zsh option to change that behaviour. It seems to have options for everything smile

Offline

#28 2005-12-21 19:59:29

Neuro
Member
From: Poland
Registered: 2005-10-12
Posts: 352

Re: A new shell?

shadowhand wrote:

Not particularly. It's just little things. Like case-insensitive completion.

Bash is case sensitive by default. But that can be changed, so that's not much of a feature wink

bind "set completion-ignore-case on"

Generally speaking, the only incompatibilities between bash and zsh arise with scripts that use globs (I had to fix a couple when I switched over).

Right, but what I don't understand is why you had changed your scripts wink It would be perfectly ok to stay with #!/bin/bash in them wink

So you say it is worth a try? Well I'll give it a go then. Thanks.

Offline

#29 2005-12-21 21:11:11

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: A new shell?

bash can also do the zsh style "menu completion" - "bind Tab menu-complete"

However, this still doesn't expand completions below it like zsh does.

i tried zsh for a bit the other day.  To me, it seems rather flaky by default... bash does everything I expect it to do with a simple "source /etc/bash_completion"

Admittedly, zsh's completion is much quicker, bash's still isn't a hinderance to me.

Offline

#30 2008-02-22 17:41:38

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: A new shell?

I love Fish. Zsh is too complicated. Bash is older than my grandma.

Offline

#31 2008-02-22 18:35:53

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: A new shell?

woohoo a thread renaissance!


I need real, proper pen and paper for this.

Offline

#32 2008-02-22 21:53:55

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: A new shell?

Anyone press tab constantly in irc and expecting it to complete? That's when you know you've been using Linux for long enough big_smile


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#33 2008-02-23 16:52:30

zodmaner
Member
Registered: 2007-07-11
Posts: 653

Re: A new shell?

dyscoria wrote:

Anyone press tab constantly in irc and expecting it to complete? That's when you know you've been using Linux for long enough big_smile

Hey! I've had that happens to me once. big_smile

Offline

#34 2008-02-23 17:33:57

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: A new shell?

Yeah! I press tab everywhere, even in the web browser's address bar. I tend to choose applications based on how good autocompletion is tongue

Anyway, I tried fish, it's very cool, but it broke just on the second run, after I changed my prompt:

switch: Expected exactly one argument, got 0
/usr/share/fish/functions/__fish_config_interactive.fish (line 150):            switch $fish_greeting
                                                                                     ^
in function "__fish_config_interactive",
        called on line 104 of file "/usr/share/fish/config.fish",

in function "__fish_on_interactive",
        called on standard input,

in event handler: handler for generic event "fish_prompt"



NAME
       switch - conditionally execute a block of commands


switch: Type "help switch" for related documentation

I can't find a way to use a config file, it seems the only way to configure fish is by issuing commands. I detest it.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#35 2008-02-23 20:05:00

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: A new shell?

Configurability only complicates things, and if their defaults are good, the complexity is unnecessary. (but I disagree with that philosophy too)

Offline

#36 2008-02-23 20:15:04

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: A new shell?

I think good standards are a good starting point, and minimalism should be encouraged, but flexibility must not be overlooked.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#37 2008-03-01 09:29:56

sweiss
Member
Registered: 2004-02-16
Posts: 635

Re: A new shell?

I'm afraid of trying new shells, until I've finally started remembering how to perform for loops in bash.
Is there any better shell which is bash compatible?

Last edited by sweiss (2008-03-01 09:36:22)

Offline

#38 2008-03-01 12:46:26

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: A new shell?

What do you mean by "bash compatible"? Programs/scripts call their own interpreters. "Better" shells exist for the user's sake, not for execution of software (there may be, I don't know). Things like simpler syntax, optimized syntax, tab-completion, it just makes life easier.


I need real, proper pen and paper for this.

Offline

#39 2008-03-01 14:35:49

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: A new shell?

schivmeister wrote:

What do you mean by "bash compatible"? Programs/scripts call their own interpreters. "Better" shells exist for the user's sake, not for execution of software (there may be, I don't know). Things like simpler syntax, optimized syntax, tab-completion, it just makes life easier.

Bash loads /etc/profile. Fish does not. So you have to keep bash as your login shell and exec fish from it. Otherwise, it will not have all the env variables.

Offline

#40 2008-03-07 02:26:35

scj
Member
From: Sweden
Registered: 2007-09-23
Posts: 158

Re: A new shell?

I'll admit that I haven't really given fish a proper test, but it seems like a toy shell. I kind of like the idea of orthogonality, but I seriously doubt anything is ever going to pry me away from zsh.

zsh = <3

Offline

#41 2008-03-07 15:06:54

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: A new shell?

scj wrote:

I'll admit that I haven't really given fish a proper test, but it seems like a toy shell. I kind of like the idea of orthogonality, but I seriously doubt anything is ever going to pry me away from zsh.

zsh = <3

Fortunately, it's not a toy shell. Those who love it, and its creator, take it seriously.

Offline

#42 2008-03-07 19:47:59

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: A new shell?

SpookyET wrote:

Bash loads /etc/profile. Fish does not. So you have to keep bash as your login shell and exec fish from it. Otherwise, it will not have all the env variables.

Login prompt is just a login prompt, you can't expect it do anything more than provide you a prompt. There's no point in having a "better" shell provide you a login prompt. /etc/profile is a BASH file, other shells have their own files. A better shell is for your live-action convenience. In short, yes you have to keep whatever "standard" shell most of your system gets in touch with, but you can have your own shell to get down and dirty yourself. See phrak's post above; bash can still be good.

Last edited by schivmeister (2008-03-07 19:51:46)


I need real, proper pen and paper for this.

Offline

#43 2008-03-07 19:52:02

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: A new shell?

dyscoria wrote:

Anyone press tab constantly in irc and expecting it to complete? That's when you know you've been using Linux for long enough big_smile

Well, I do it all the time, and it works tongue


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#44 2008-03-07 21:16:00

mienensuchkind
Member
Registered: 2007-01-21
Posts: 61

Re: A new shell?

is it possible in fish, that the filetype information at autocompletition isn't shown?
i think that feature is quite useless, since you dont need a hint like "(Directory)" or "(Application, 24MB)" behind any option-for-autocompletition (you know, if you double-tap-tab)...

Offline

#45 2008-03-07 21:56:47

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: A new shell?

So, did anyone manage to customise fish without breaking it? I really liked it, but I need to be able to customise it and still have it working properly. My .bashrc is getting bigger and bigger, and I'm getting used to my functions. It would be nice to "port" them to fish as well. I really dislike the idea of not having a config file, life would have been easier that way tongue


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#46 2008-03-07 23:53:28

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: A new shell?

finferflu wrote:

So, did anyone manage to customise fish without breaking it? I really liked it, but I need to be able to customise it and still have it working properly. My .bashrc is getting bigger and bigger, and I'm getting used to my functions. It would be nice to "port" them to fish as well. I really dislike the idea of not having a config file, life would have been easier that way tongue

.config/fish/config.fish

Offline

#47 2008-03-08 14:08:11

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: A new shell?

Mind sharing your config file then? tongue


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#48 2008-03-08 15:44:44

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: A new shell?

finferflu wrote:

Mind sharing your config file then? tongue

function pacman; pacman-color $argv; end;
function p; pacman $argv; end;
function y; yaourt $argv; end;
function netcfg-scan; iwlist scan $argv; end;

#Bash-like prompt
#function fish_prompt -d "Write the prompt"
#    printf '%s%s %s%s  %s$%s  ' (set_color green) (whoami) (set_color cyan) (prompt_pwd) (set_color -o green) (set_color normal)
#end
 
# Hostname
#function fish_prompt -d "Write the prompt"
#    printf '%s%s%s@%s%s %s%s %s>%s ' (set_color green) (whoami) (set_color -o normal) (set_color blue) (hostname | cut -d . -f 1) (set_color -o cyan) (prompt_pwd) (set_color -o green) (set_color normal)
#end


function fish_prompt -d "Write the prompt"
    printf '%s%s %s%s %s>%s ' (set_color green) (whoami) (set_color -o cyan) (prompt_pwd) (set_color -o green) (set_color normal)
end

set SHELL (which fish)

Offline

#49 2008-03-08 16:17:12

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: A new shell?

Thanks a lot, now this is gonna be fun. I'll use yours as a starting point smile


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#50 2008-03-08 18:02:08

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: A new shell?

Ok, that was veeeeeeeeery nice. I was fiddling with fish, and I liked it. So I went on and made it my default shell. The nice thing is that at the login shell it just hangs at the MOTD (with 100% CPU usage, of course). So I couldn't get into my machine anymore, since I have disabled the root account. I had to boot up Knoppix and edit /etc/passwd manually. That's just too bad. Now I have to type "fish" every time I want to use it sad

Last edited by finferflu (2008-03-08 18:02:34)


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

Board footer

Powered by FluxBB