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 type in ...
TL;DR: Make sure RVM is up-to-date to at least 1.26.11 by re-installing or issuing the command rvm get head, and is only being initialized once per terminal environment.
Eventually I was able to fix my environment. I will post some information pertaining to my specific problem in an effort to help some, even though others may have the same symptom ...
The 'fish' way of setting the $PATH variable is to actually use set --universal fish_user_paths $fish_user_paths /new/path/here. Then $fish_user_paths is actually prepended to the $PATH variable when a new session starts. The $PATH documentation doesn't currently tell you how to delete it though.
In fish every variable is actually a list (array), and you ...
You can use bash to parse /etc/profile and ~/.profile, and then start fish.
Create /usr/local/bin/fishlogin with contents
exec -l fish "$@"
Make it executable
sudo chmod a+rx /usr/local/bin/fishlogin
Check that it works by running fishlogin and checking that you end up in a Fish shell. Press Control+D to exit the Fish shell.
First thing to point out is that you can do this via tmux completely independent of your shell. Add the following to your ~/.tmux.conf; for example:
set-option -g set-titles on
set-option -g set-titles-string "#S / #W"
Also, you need to ensure iTerm2 is configured to let programs set the title via an escape sequence. See the "Terminal may set tab/window ...
Unfortunately, the assumption that stderr is only used for error output isn't always correct. Rather, stderr is often used for any and all interactive output and diagnostics, i.e. output intended for the user to read in an interactive prompt1. wget and dd are well-known examples.
Some commands will provide a flag (e.g. -quiet or -silent) to suppress non-...
For sourcing a general sh script in fish, one option is the bass plugin, which can source a bash script's environment variables into fish.
If you have fisherman, you can install it with fisher install edc/bass, then run bass source <command>.
The logical operators you're used to, are supported since fish 3.0.0, released on 2018-12-28.
From the v3 release notes:
fish now supports && (like and), || (like or), and ! (like not), for better migration from POSIX-compliant shells (#4620).
I found this perfect answer on the fish-users mailing list:
switch (commandline -t)[-1]
commandline -t $history; commandline -f repaint
commandline -i !
switch (commandline -t)[-1]
commandline -t ""
~/.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.
echo (pwd) '> '
As Elijah says, best practice is to modify the fish_user_paths rather than the global PATH. To avoid ever having to Google this again…
Create a couple of functions that only modify fish_user_paths
Make both functions autoloading
To add to user paths:
contains -- $argv $fish_user_paths
or set -U fish_user_paths $fish_user_paths ...
Unix utilities send general messages to stdout, and error messages to stderr, so if we only want to see error messages, then it will be sufficient to suppress stdout so only stderr gets output to the console.
The way to do this (in both bash and fish) is to append >/dev/null to the command. This pipes stdout into nothingness, but stderr (with your error ...
Bash uses readline for interactive input, so syntax highlighting would need to be implemented in that program. I found a Google Groups discussion about how to code such a feature.
The fish shell uses its own line editor that is specific to that program, and can not be directly ported.
You may find that zsh is very similar to bash, and its line editor is ...
Some settings, such as the color theme, are stored as universal variables. Run set -U to see them.
Note that at the moment universal variables are stored in a file whose name is unique to each host. In the upcoming fish 3.0.0 release we're going to make that file truly global so that simply copying your ~/.config/fish directory tree to another machine will ...
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:
if test "$argv" = !!
eval command sudo $history
command sudo $argv
There are a lot ...
Sorry, I'm not sure if I understand what you're asking. But if your question is how to set your abbr definitions on startup (and in a file that you can store in a repository and share between machines), you should use the file ~/.config/fish/config.fish which is Fish's equivalent to .bashrc in Bash.
Since abbreviations are stored in global/universal ...
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
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 variables ...
If you found this question wondering how to change the window/tab title in fish, and the fish_title function works for you (see Chris Page's answer), then here's an example that sets the title to use a shortened version of your working directory.
$ funced fish_title
if [ $_ = 'fish' ]
There is no simple way to obtain syntax highlighting in GNU Bash (or GNU Readline), but it is in principle possible to implement your own line editor in Bash scripts by binding all the user inputs to shell functions using the builtin command bind -x 'BYTE: SHELL-COMMAND'. It is of course possible to integrate the feature of syntax highlighting in your own ...
You can use Bass.
Clone the git repository
git clone https://github.com/edc/bass.git
Then cd in the cloned directory and type
bass source ~/.nvm/nvm.sh ';' nvm use stable
Now you should be able to use node inside fish shell.
fish doesn't implement incremental history search, although it seems to come up fromtime to time. The pre-2.0 documentation has a "Missing features and bugs" section 1 which lists incremental history search fairly far down in the "Possible features" list. The fish-users mailing list includes this message from Axel Liljencratz, dated August 21, 2006, in which ...
Fish has exactly one user controlled config file which is named $HOME/.config/fish/config.fish by default. Fish also has an export command for compatibility with bash/zsh/sh but it just a thin wrapper around the fish form:
set -gx VAR value
As for bash aliases you have two choices: turn them into abbreviations (see the "abbr" command) or functions. In fish ...
There are many options for configuring bash. I use the following commands to give easy command history access:-
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
These set the Up and Down arrows to scan up and down the command history for commands beginning with the characters before the cursor on the command line (as TCC does in ...