You are not logged in.

#1 2006-03-19 07:51:01

EAD
Member
Registered: 2006-03-11
Posts: 255

fish shell, any one tried?

Hii, anyone tried Fish shell?
Is it good?
worth it more then BASH?
:?:

Offline

#2 2006-03-19 12:34:22

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

Re: fish shell, any one tried?

Try it yourself. We dont know what you like.

Offline

#3 2006-03-19 13:27:56

syamajala
Member
From: here, there, everywhere
Registered: 2005-01-25
Posts: 617
Website

Re: fish shell, any one tried?

to me fish seemed like zsh. The differences were the highlighting and the auto-completion. I don't really see why fish highlights the first 2 letters when it only is going to show matches that have those 2 letters in them. I also found that fish's auto-completion reveals too many details that i don't care about. Why would i ever care about the size of an app when i'm running it? If you're look for a replacement for bash try zsh.

Offline

#4 2006-03-19 14:53:24

cmp
Member
Registered: 2005-01-03
Posts: 350

Re: fish shell, any one tried?

I just installed it. fish seems nice, but it feels a little bit slow. I guess it's because everything is implemented as function.
There were also some errors in the scripts:
I always got some complaint from grep and awk when doing tab-completion, but adding a simple 2>/dev/null behind the completion functions solved the problem.

Why would i ever care about the size of an app when i'm running it? If you're look for a replacement for bash try zsh.

you may change that. you got to hack /usr/share/fish/functions/__fish_describe_command.fish. but i can't figure out what you got to change.

Offline

#5 2006-03-19 16:43:17

max_sipos
Member
From: Ithaca, NY
Registered: 2004-10-31
Posts: 106
Website

Re: fish shell, any one tried?

Hello,

I've hacked up a quick syntax completion for pacman:

# Completion for pacman
# All-time options
complete -c pacman -s h -l help -d (N_ "Display syntax for given operation")
complete -c pacman -s d -l nodeps -d (N_ "Skip dependency checks")
complete -c pacman -s f -l force -d (N_ "Bypass file conflict checks")
complete -c pacman -s r -l root -d (N_ "Specify alternative instalation root (/)") -r
complete -c pacman -s v -l verbose -d (N_ "Output more messages")
complete -c pacman -l config -d (N_ "Specify alternate config file") -r
complete -c pacman -l noconfirm -d (N_ "Bypass any questions")
complete -c pacman -l noprogressbar -d (N_ "Don't show progress bars when downloading")

# Sync options
set -- pacman_sync -c pacman -n "__fish_contains_opt -s S sync "
complete $pacman_sync -s c -l clean -d (N_ "Remove old packages from cache")
complete $pacman_sync -s g -l groups -d (N_ "Display packages in a group; list all groups")
complete $pacman_sync -s i -l info -d (N_ "Display information for package")
complete $pacman_sync -s l -l list -d (N_ "List all files in the specified repositories")
complete $pacman_sync -s p -l print-uris -d (N_ "Print out URIs for packages to be installed")
complete $pacman_sync -s s -l search -d (N_ "Search for packages")
complete $pacman_sync -s u -l upgrade -d (N_ "Upgrade all packages out of date")
complete $pacman_sync -s w -l downloadonly -d (N_ "Only download packages")
complete $pacman_sync -s y -l refresh -d (N_ "Refresh package list")
complete $pacman_sync -l ignore -d (N_ "Ignore given package")
set -e pacman_sync

# Remove options
set -- pacman_remove -c pacman -n "__fish_contains_opt -s R remove "
complete $pacman_remove -s c -l cascade -d (N_ "Also remove all packages that depend on these packages")
complete $pacman_remove -s k -l keep -d (N_ "Only remove database entry, leave files in place")
complete $pacman_remove -s n -l nosave -d (N_ "Don't save .pacsave files")
complete $pacman_remove -s s -l recursive -d (N_ "Remove with unneeded dependencies-reverse sync")
set -e pacman_remove

# Query options
set -- pacman_query -c pacman -n "__fish_contains_opt -s Q query "
complete $pacman_query -s e -l orphans -d (N_ "List all packages explicitly installed")
complete $pacman_query -s g -l groups -d (N_ "Display groups the package is member of")
complete $pacman_query -s i -l info -d (N_ "Display information for package")
complete $pacman_query -s l -l list -d (N_ "List all files owned by package")
complete $pacman_query -s m -l foreign -d (N_ "List packages not found in sync database")
complete $pacman_query -s o -l owns -d (N_ "Search for package that owns <filename>") -r
complete $pacman_query -s p -l file -d (N_ "Query this package (filename given on cmd. line)")
complete $pacman_query -s s -l search -d (N_ "Search for package")
set -e pacman_query

# General options
set -- pacman_mode -c pacman -n '__fish_contains_opt -s A -s F -s Q -s R -s S -s U -s V add freshen query remove sync upgrade version; if test $status = 0; false; else; true; end'
complete $pacman_mode -s A -l add -d (N_ "Add a package to the system") -r
complete $pacman_mode -s F -l freshen -d (N_ "Upgrade already installed packages")
complete $pacman_mode -s Q -l query -d (N_ "Query the package database")
complete $pacman_mode -s R -l remove -d (N_ "Remove a package from the system")
complete $pacman_mode -s S -l sync -d (N_ "Synchronize packages")
complete $pacman_mode -s U -l upgrade -d (N_ "Upgrade a package") -r
complete $pacman_mode -s V -l version -d (N_ "Display version and exit.")
set -e pacman_mode

The file goes into /usr/share/fish/completions/pacman.fish. I didn't pay much attention to details and there is no completion for installed or remote packages (querying pacman for that would take too long ATM). It would be nice if the maintainer of fish in AUR include this file with the package.

Best,
--Max

Offline

#6 2006-03-19 18:02:12

max_sipos
Member
From: Ithaca, NY
Registered: 2004-10-31
Posts: 106
Website

Re: fish shell, any one tried?

The more I play with fish the more I like it. It's simpler than zsh, and autocompletion works out of the box. Besides the powerful autocompletion, it also shortens the path when it becomes long (/usr/share/fish/completions becomes /u/s/f/completions), and writes the current program running and path to the terminal title. All that without any setup.

Writing completions is also very easy, here's another one, for makepkg:

# makepkg syntax completion

complete -c makepkg -s b -l builddeps -d (N_ "Build missing dependencies from ABS")
complete -c makepkg -s B -l noccache -d (N_ "Don't use ccache")
complete -c makepkg -s c -l clean -d (N_ "Clean up leftover dirs after the build")
complete -c makepkg -s C -l cleancache -d (N_ "Remove all source files from cache dir")
complete -c makepkg -s d -l nodeps -d (N_ "Don't perform dependency checks")
complete -c makepkg -s e -l noextract -d (N_ "Don't extract source files (use src/)")
complete -c makepkg -s f -l force -d (N_ "Force build")
complete -c makepkg -s g -l genmd5 -d (N_ "Download sources and generate md5 hashes")
complete -c makepkg -s h -l help -d (N_ "Help")
complete -c makepkg -s i -l install -d (N_ "Install/upgrade package after build")
complete -c makepkg -s j -d (N_ "Set MAKEFLAGS") -r
complete -c makepkg -s m -l nocolor -d (N_ "Disable color in output messages")
complete -c makepkg -s n -l nostrip -d (N_ "Don't strip binaries and libraries")
complete -c makepkg -s o -l nobuild -d (N_ "Download and extract files only")
complete -c makepkg -s p -d (N_ "Specify file alternative to PKGBUILD") -r 
complete -c makepkg -s r -l rmdeps -d (N_ "Upon build, remove dependencies installed by makepkg")
complete -c makepkg -s s -l syncdeps -d (N_ "Install missing dependencies via pacman")
complete -c makepkg -s S -l sudosync -d (N_ "Install missing dependencies via sudo pacman")
complete -c makepkg -s w -d (N_ "Specify destination directory")
complete -c makepkg -l noconfirm -d (N_ "Don't ask questions")
complete -c makepkg -l noprogressbar -d (N_ "Don't draw progress bar")

Best,

--
Maksim

Offline

#7 2006-03-21 13:24:20

syntax
Member
From: Saint-Truiden
Registered: 2006-03-04
Posts: 19
Website

Re: fish shell, any one tried?

fish is nice but it just isn't my thing, I just keep it with bash.
it really depends on what flavor people like.


-kupo-

Offline

#8 2008-02-22 17:36:47

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

Re: fish shell, any one tried?

Fish rocks! It is my thing. I just jumped ship.

Last edited by SpookyET (2008-02-22 17:37:05)

Offline

#9 2008-05-26 15:08:29

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

Re: fish shell, any one tried?

To get environmental variables in fish, paste this in .config/fish/config.fish

# FISH does not accept non existing paths, clean it
set tmp_path $PATH
setenv PATH
for path in $tmp_path
  setenv PATH $PATH $path ^ /dev/null
end

if status --is-login 
  for line in (sh --noprofile --norc -c '. /etc/profile; env')
    set variable (echo $line | cut -d '=' -f 1)
    set value (echo $line | cut -d '=' -f 2-)
        # Convert to array
    if test (echo $value | grep ":")
      set value (echo $value | sed -e 's/:/\n/g')
    end
    if test $variable = PATH
      for path in $value
        setenv PATH $PATH $path ^ /dev/null
      end
    else
      setenv $variable $value ^ /dev/null
    end
  end
end

Last edited by SpookyET (2008-05-26 15:08:56)

Offline

Board footer

Powered by FluxBB