veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

295
active users

#fishshell

2 posts2 participants0 posts today

For sharing a common Fish shell configuration between multiple operating systems, the `switch` command is useful.

Using `switch` I can execute different blocks of code depending on the OS reported by `uname`.

Example:

```
switch (uname)
case FreeBSD
abbr -a l ls -aFhl --color=always
case NetBSD
abbr -a l colorls -aFGl
end
```

See: fishshell.com/docs/current/cmd

fishshell.comswitch - conditionally execute a block of commands — fish-shell 4.0.1 documentation
Replied in thread

@tsvenson the usability you get from fish without any configuration is very polished, like a more easy directory navigation, a more gentle language, safe copy-paste behavior, amazing auto completion... nothing less should be a default shell on any system

just learned one can quickly visit historical directory locations in fish shell with alt-left, then forward in history with alt-right

one can alternatively type "prevd" or "nextd"

one more thing, "cdh" can be used to list all dirs that have been visited, with an option to visit any of them quickly

For ages I used `bash` simply because its the default shell on most Linux distributions. Now that I'm exploring FreeBSD I thought to myself, why not also consider alternative shells?

I briefly used the FreeBSD default `sh`, then spent a few weeks with `oksh` (portable version of OpenBSD `ksh`). Inspired by @b0rk 's "Reasons I still love the fish shell" I decided to give the aforementioned shell I try... 🐟

dwarmstrong.org/fish-shell/

I ❤️ it and its my new interactive shell.

www.dwarmstrong.orgGetting Started with Fish ☯ Daniel Wayne ArmstrongLibre all the things

I'm exploring the fish shell today. Right off the bat with no tweaking its pretty nice!

And if you run `fish_config` in a terminal it opens a configuration panel in the browser. I just used it to create a prompt in the Nord colour palette, and working from the auto-generated output I can further customize it manually to get it looking the way I like.

fishshell.com/

fishshell.comfish shellA smart and user-friendly command line shell

I’m having a weird lil problem with Fish shell. I’ve just finished to write a little script to use with my Waybar config. The script is located at ~/.config/fish/functions/the-script.fish and have inside it multiples functions.

When I’m calling the script directly from my Fish shell, the script works perfectly. But if I call the script with fish -c the-script.fish(which is what I’m basically doing with Waybar), the script throw stupid errors like “Uhh command what (when calling a function)? None of theses words are in the bible.”

And I don’t get why Fish behaves so differently depending on how I call the script :neocat_woozy:

RT appreciated :neocat:

(The script I’m talking about as reply bellow)

Edit: Nevermind, I figured out what I was doing wrong. The problem was that I tried to make local functions nested inside the script’s main function. Apparently that wasn’t the right thing to do with Fish. Moving theses functions outside function niri-color-scheme‘s scope did make the script works like intended.

I experimented with not having persistent shell history, after @simontatham blogged about it.

Good:
- higher threshold for writing long complicated commands
- lower threshold for writing shell scripts instead

Bad:
- writing shell scripts

I've since started experimenting with the Fish shell, and it brings a whole different level to the shell history game. So far I like it.