Hot answers tagged fish
Fish doesn't have a special syntax for a logical AND (&&) or a logical OR (||). Instead, you can use the commands and and or, which verify the previous command's exit status and act accordingly: command1 and command2 command1 or command2 Furthermore – just like in bash – you can use a semicolon ; to execute two commands one after the other: ...
I have used zsh and fish. Both offer many more user-friendly features than bash. And, I know that zsh advertises itself as a shell, versus a scripting language. And, I have to agree completely. If I'm going to write a script, I always use bash. However, for my CLI, I prefer fish. While zsh is pretty, fish, is phenomenal! I do agree with some of the ...
This article explains a lot of fish's advantages over bash and zsh. Fish has one great weakness though - even if it has great features, it has next to no user base or community around it. The development is not that active either - the last version is over a year old. In my personal experience zsh offers everything that fish has offer(after some ...
@endolith: Yes, it only seems to affect fish. I had the same problem, the issue is caused by the sudo option "tty_tickets". Disabling this on your /etc/sudores will solve the problem. The following will disable tty_tickets: Defaults env_reset,!tty_tickets
Here's how I managed to compile fish in Cygwin. Step 1: Check that all dependencies are installed First, make sure we have the following cygwin packages: libncurses-devel libiconv autoconf (not a really a dependency of fish, but we need it for a later step) Step 2: Download and extract the latest source Next, download the latest source from ...
I've never used fish myself but a cursory google search brought up this page which states that Powerful History Mechanism Modern shells save previous commands in a command history. You can view earlier commands by using the up and down arrows. Fish extends this concept by integrating the history search functionality. To search the history, simply ...
Alt-Up arrow gives you the last argument from the previous command. Subsequent pushes cycle throught prior arguments. I haven't found a satisfactory equivalent to !!, except Up then Ctrl-A
Did you remember to mark $GOPATH in fish as exported? set -x GOPATH /home/<me>/workspace/go-workspace It's not sufficient to test with echo $GOPATH since that will work regardless of whether the variable is exported. Check with bash -c 'echo $GOPATH' which will only print the value of GOPATH if it has been exported. In bash, you export ...
fish shell 2.1.0 is now officially supported in Cygwin, it's possible to install it using the default installer.
My current solution (see here for a maybe more recent version): egrep "^export " ~/.profile | while read e set var (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\1/") set value (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\2/") # remove surrounding quotes if existing set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/") if test $var = ...
If nothing else works, try sudo -i (by itself). That'll give you a root shell after one password.
I had to be dragged kicking and screaming to use zsh at a previous job after many years of bash. But when I saw the features available in zsh and the compatibility with bash I was hooked. Now I've had to revert to bash and I miss many of the advanced features of zsh. I'd head towards zsh for the following reasons: As Bozhidar pointed out, pick a shell ...
solution: choose if you want a system wide setting or an user config and edit the appropriate configuration file, don't use path_helper with fish. more fish doesn't source /etc/profile, for system wide and user config it'll read /etc/fish/config.fish and ~/.config/fish/config.fish respectively . path_helper is meant for using for shells that source a ...
So when I run ./install.sh it should be processed by bash, right? Indeed. That's exactly what the shebang is for. Troubleshooting Save the following as test.sh and try to run it from fish. #!/bin/bash true && true It works on my computer, and it should on yours. Check if the first line of install.sh contains only the characters ...
It looks like you want: set -xg PATH /opt/local/bin /opt/local/sbin $PATH Edit: I see what you mean, this syntax takes some getting used to. It wants spaces instead of colons, and it can't be in quotes, and all the paths in your current PATH must actually exist (in my case, I had /usr/local/sbin in my PATH even though it didn't actually exist, and that ...
In fish, $ is used only for variable expansion. Omit the $ from the command and you should be good. Say: ls -l (which vim) You might also want to refer to the documentation: Command Substitutions
I dont think syntax highlighting should happen at the shell level but at the interface level (just my opinion -and someone else's it seems-), so I would look into "plugins" for Terminal or your favorite console, for example this plug in for Kate might help, or this other one which offers syntax highlighting in nano Here is still more talk about how to ...
Below is what I have in ~/.config/fish/config.fish for your specific example. set -gx HOSTNAME (hostname) if status --is-interactive; keychain --nogui --clear ~/.ssh/id_rsa [ -e $HOME/.keychain/$HOSTNAME-fish ]; and . $HOME/.keychain/$HOSTNAME-fish end The source command is ., which also works in bash.
Thanks to Aaron for responding and for all those who answered other similar questions on the stackexchange sites. For posterity's sake, here is what I figured out: path_helper is called from /etc/profile, by the syntax eval '/usr/libexec/path_helper -s' (where the apostrophes are actually backticks). Like a dummy, I didn't know how backticks worked, and so ...
From the documentation: The and builtin is used to execute a command if the current exit status (as set by the last previous command) is 0. COMMAND1; and COMMAND2 So you'd call: make; and make install
sudo !! (or sudo bang bang) is one of my most oft used commands. I'm still using just plain old bash that has it just fine. Sorry to hear that fish doesn't implement it correctly. A little googling and I found this: function sudo if test "$argv" = !! eval command sudo $history else command sudo $argv end end There are a lot ...
Doesn't fully answer your questions but probably a bit more than just a comment: Based on other comments in your answer, I think the error you saw is fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. That occurs because you're conducting these tests on a brand new git repository, one that has no committed work. Not only is ...
I have absolutely no idea about /etc/paths.d, path_helper, &c., all of which seem like excessive complications to me, but the following at the end of your ~/.bashrc should put you right: PATH=/usr/local/bin:$PATH Hope this helps!
~/.config/fish/config.fish is empty by default. To create a custom prompt create a file ~/.config/fish/functions/fish_prompt.fish and fill it with your prompt. Basic example function fish_prompt echo (pwd) '> ' end
@Yaakov's proposal is actually quite close, but to compile fish 2.0 successfully you would need to comment/remove offending line from fallback.h and invoke configuration with: ./configure CXXFLAGS='-I/usr/include -I/usr/include/ncursesw' after which you should be able to make and make install
I installed fish (1.23.1) to investigate this. It turns out that fish only updates the title if $TERM is one of the following: xterm, screen, nxterm, rxvt. Otherwise, it never calls the fish_title function. Terminal's default value is xterm-256color and prior to Mac OS X Lion 10.7 it was xterm-color, neither of which is recognized by fish. Fish is simply ...
Add this function to your fish configuration: function bc; command bc -l $argv; end Since math calls bc, this will take care or your issue.
Sammyg was correct that set_color is what you're looking for. The trick is that a single call to set_color doesn't color a specified block of text, but sets the color that all subsequent text will be printed. The -b flag sets the background color. Here's a simple function which will give you a similar effect to that zsh prompt (put it in your fish/functions ...
fish is all about minimalism: if there's a common utility that does the job easily, it's not in fish. So, as you say, with sed: set branch (sed 's#^ref: refs/heads/##' .git/HEAD)
To reset fish to its starting state, delete (or rename) ~/.config/fish.
Only top voted, non community-wiki answers of a minimum length are eligible