Masthash

#FishShell

Josh Finnie
2 days ago

alright, i've gone back to fish shell after too long. it's just superior to zsh and bash. If you want to follow along with my setup, you can read it here:

https://www.joshfinnie.com/blog/moving-from-oh-my-zsh-to-starship-and-fish-shell/

#fishshell #command_line #terminal #starship

The Bean Identity
2 days ago

Alright, gonna try something different: An actually useful poll!

#fishshell users: Why do you use alias instead of abbr or function?

The Bean Identity
3 days ago

Anyway my fish-snippets repo now contains a half-assed Implementation of ^foo^bar history expansion (run the last command with foo replaced with bar) for #fishshell

Benedikt Ritter
1 week ago

It was surprisingly easy to port all my custom fish and git config to home manager. The next big thing I need to figure out is how to manage multiple java versions and assign their directory to environment vars. Currently using @asdf_vm but it doesn‘t seem to work on @nixos_org. #linux #nixos #homemanager #java #fishshell #git #asdfvm #shell #dotfiles

LastContinue
2 weeks ago

TIL about the `cdh` command in #FishShell

https://fishshell.com/docs/current/cmds/cdh.html

Pretty cool!

Drew :guix:
2 weeks ago

fish is magical, if you edit a file in a git repository, and go to any directory in the repository, git add will autocomplete to that file with the correct path. :blobcatcoffee:​

#git #fishshell #shell

Ok i got my #Fish #FishShell completions running in #NuShell on #NixOS.
We will see if i adapt it as my daily driver, since i hardly use #posix stuff anyway.
If you were struggling like me to configure the completions with #HomeManager, let me know and i will share the config tomorrow.

Sven A. Schmidt
3 weeks ago

Is there a default directory for #nushell functions that gets scanned and loaded?

For example in #FishShell, any function in `~/.config/fish/functions` gets loaded as an executable command.

Best I can tell, I'd have to add a `source <myscript>` line to my startup config for each new command. There's probably a better way, isn't there?

danrot
4 weeks ago

💡Recently I had the idea to use shell variables for my #CLI commands to make them more reusable when executing that from my history in #FishShell.

✏️ To better explain how I have done that, I wrote a blog post about it!

❓ Do you also have nice use cases for shell variables? It feels to me like I have heavily underused them until now...

https://danielrotter.at/2023/09/02/making-the-shell-history-more-useful-by-using-shell-variables.html

Yann Büchau :nixos:
1 month ago

I got #nuShell configured with #starship prompt and solarized light theme. Looking forward to testing it as my default shell.

Nitpicks: Compared to #fishShell, many completitions are missing for external commands and need extra plugins. What bugs me is that TAB doesn't cycle through options, but one has to confirm with ENTER to continue. NuShell's vi editing mode is meh compared to fish's.

But pipelining is awesome and blocks are scoped, helpful because fish doesn't have subshells (wtf).

Jamie Magee :unverified:
1 month ago

Long time user of #FishShell, but #NuShell is very tempting!

#POSIX #Shell #CLI #CommandLine

Tshepang Mbambo
1 month ago

@gim I have not seen a more pleasant interactive experience like #fishshell provides (and not just great completion system), at least not without any configuration at all, and the language is a step forward compared to posix shells (more consistent, more clean)

Steffo
1 month ago

#FishShell now supports $(...) substitutions?! 😮

Shevek
1 month ago

@victorhck Este tema de configuración de emuladores de terminal básicos sigue siendo misterioso.

En mi caso, me gustaría saber cómo configurar los emuladores VTn (los que se accede mediante ctrl-alt-Fn). Cuando uso un gestor de terminal sofisticado como #fishshell, con prompts complejos (en mi caso "tide"), entonces en las VTn se ve bastante mal.

Creo que el "truecolor" no es configurable, pero la fuente de caracteres sí debería serlo.

¿Sabes cómo podría hacerlo?

The Bean Identity
1 month ago

What happened was this:

We want to allow _ in numbers, so you can do:

math 1_000_000 + 7

But we don't do the number parsing ourselves, we pass it off to a proper number parsing function - used to be libc's wcstod, now it's fast-float-rust.

So, we pre-process the number - we take all the non-underscores, and keep track of where we removed the underscores (so we get a good position for errors and stuff). Only we get the entire string and only the number parser really knows where to stop.

So if we get a string like 1+2+3+..10000, we would copy the entire thing, send it off to the number parser, it would read 1 whopping byte and return the result, we would get 2+3+..10000 and repeat.

The solution is to figure out that those plusses aren't signs, they're operators. Which gets tricky once you allow 1e+5 and 0xe+5 (and the plus is a sign in the former). Oh well, #fishshell

૮༼⚆︿⚆༽つ
1 month ago

Wild idea...
Replacing my #fishshell setup with #oilshell + #carapace 🤔

Yann Büchau :nixos:
1 month ago

@swflint Thanks. #StarshipPrompt doesn't seem to notice this shell change though, while it does for 'nix-shell -p git-extras --run fish'. Shouldn't be a :fish_shell: #fishShell issue though.

UPDATE: nix-shell sets the IN_NIX_SHELL=[im]pure environment variable (and a whole bunch of others) while nix shell only touches the PATH. Hard to detect for any program that this change happened!

Sean
1 month ago

There is an alias for bash to use cheat.sh and receive the cheatsheet for a command while inside your terminal.

For fish users use function:

function h
curl -s -L cheat.sh/$argv | less -R
end

Then type: function h cat

You will get the cheatsheet to cat within your terminal session.
#terminal #fishshell #linux

Jay
1 month ago

After sticking with #bash forever, I think I'm gonna try switching to #FishShell. Any tips?

masukomi
1 month ago

Does anyone know if there's a way in #FishShell to have text printed via STDOUT colored differently? Or maybe a way in #iterm2 or Kitty ?

(I've been pondering switching to Kitty, but don't want to deal with configuring everything.)

The Bean Identity
2 months ago

The three measures of #fishshell carcinization:

Amount of C++ lines removed:
[-------🦀 30.134%]
Amount of SLOC of Rust vs Sloc of C++:
[------------🦀 49.34%]
Amount of bytes of Rust vs bytes of C++:
[----------🦀 42.627%]

Holly Becker
2 months ago

Thanks to @b0rk 's comic on xargs https://wizardzines.com/comics/xargs/ I used xargs for the first time the other week, and today I tried something more complicated. I'm chagrined that I'm intimidated by it, considering how comfortable I am on the command line generally, and glad to be getting over that. xargs is super useful!
#linux #bash #fishshell #computers

Steffo
2 months ago

@b0rk@social.jvns.ca :

Definitely
#FishShell! Having intuitive and discoverable key combinations helped me so much...

I think it would be even better if it had more features built-in!

Dusty Pomerleau
2 months ago

Ok, I have to say, the difference in speed moving from #zsh to #fishshell is really noticeable. I now regret putting this off for so long.

@carlschwan @SylvieLorxu ,

I also made the following #FishShell command for it:

https://gitlab.com/hook/dotfiles#reuse-wrapper-for-existing-git-repos

It’s missing the copyright holder automation, because I feel that one is even more iffy to automate – if you decide to do that, at least make sure to differentiate between the Author and the Committer fields in #git

https://matija.suklje.name/how-and-why-to-properly-write-copyright-statements-in-your-code#but-doesnt-gitmercurial-keep-a-better-track

#REUSE #ReuseSoftware

The Bean Identity
2 months ago

Statistically, I wouldn't be surprised if most #fishshell installs are on Steam Deck (because it's preinstalled)

yugaego 🌻
2 months ago

#TIL : #fishshell #argparse

"
This command makes it easy for fish scripts and functions to handle arguments.
"

Example from docs:
```
function mybetterfunction
argparse h/help s/second -- $argv
or return

if set -ql _flag_help
echo "mybetterfunction [-h|--help] [-s|--second] [ARGUMENT ...]"
return 0
end

if set -ql _flag_second
echo $argv[2]
else
echo $argv[1]
echo $argv[3]
end
end
```

https://fishshell.com/docs/current/cmds/argparse.html

The Bean Identity
2 months ago

Aaand the new and improved https://fishshell.com/ redesign is live!

Get it while it's hot pink!

#FishShell

The Bean Identity
2 months ago

Honestly this idea ain't half bad #GraphicDesignIsMyPassion #FishShell

The fishshell website except the main article thing's background is hot pink on a purple backdrop, the text is in comic sans and the logo is shittily hand drawn

It still tells you about "a command line shell for the 90s"
The Bean Identity
2 months ago

New design idea for fishshell.com

#fishshell

The fishshell.com header, except the font is Comic Sans and the logo is replaced with a shitty hand-drawn version

The text proclaims:

"Finally, a command line shell for the 90s

fish is a smart and user-friendly command line shell for Linux, macOS, and the rest of the family."

And the logo is an ascii-art fish on a monitor
Stark
2 months ago

@zanchey

How does the code-base continue working if you progressively replace C++ with Rust? Are you going class-by-class, module-by-module and have some inter-language communication? Or are these separate services? Is there more information about this process?

#CPP #Rust #Rustlang #opensource #FishShell #riir #development

danrot
2 months ago

@GPHemsley I am using #FishShell, which has `ll` aliased to `ls -lAh` by default, that's how I found out about it 😅

Collin Donnell
2 months ago

The other reason I end up not using #FishShell after a while is that the command language is different. I get that the traditional one kind of sucks, but I already know it and this just means having to know two things.

The Bean Identity
3 months ago

So since tokei is a bit minimalist when it comes to output formatting options, and because I never got jq, I've now resorted to piping json to python.

And it tells me #fishshell is at:

Rust 34031 43.46%

🦀: [========> ] 43%

(when counting lines of code, percentage is "of compiled code", so only counting C++/Rust)

The Bean Identity
3 months ago

I should make a list of "conference talks that feature a surprise appearance of #fishshell".

Today's entry: Benno Rice's "What Unix Cost Us"

The Bean Identity
3 months ago

Here's #fishshell's new Writing Your Own Prompt tutorial-ish document.

(and also I did cave and uploaded docs built from an unreleased commit - I'm probably gonna do that sometimes when there's something to show off)

The Bean Identity
3 months ago

Turns out the share of Debian systems with #fishshell installed has almost doubled since 2018.

(source)

A graph showing "percent of submitters" vs date.

It starts at a little under 0.9% in January 2018, has a big jump from 1.2% to 1.5% in January 2021 and goes up in-between, ending at between 1.7% and 1.8% in 2023-07
yugaego 🌻
4 months ago

@jai_oh I didn't check _much_ the code, but #fishshell, a very interesting project by itself, is being ported to #rustlang

I see there's a wrap up on this at https://news.itsfoss.com/fish-shell-rust/

https://github.com/fish-shell/fish-shell

As a #Emacs lover, I also followed https://github.com/remacs/remacs for some time, but the project isn't maintained anymore. Still could be interesting for users of Emacs.

The Bean Identity
5 months ago

The #fishshell carcinometer of the week:

🦀: [=====> ] 30%

The Bean Identity
6 months ago

New #introduction

Hi, I'm Fabian! Some people have taken to call me Bean (as that's what Fabian derives from).

I like puns, music, videogames and computers as long as we don't insist on repeating our mistakes from the 1970s or harming people.

I also like when people have the freedom and the means to be themselves. I like seeing my friends happy.

Sometimes you'll see me tooting about #fishshell, which I'm involved with, but honestly mostly it's jokes and my opinions on stuff and/or things (sometimes both!).

I'm a 30-something dude from Germany, but ~99% of my posts are in english.

Very proud to have figured out the #fishshell command `psub` this morning.

Diffing the headers of two web pages in `fish`:

diff (curl -sI <url-1> | sort | psub) (curl -sI <url-2> | sort | psub)

#fishtricks #shell #code

Hynek Schlawack
8 months ago

OMG how did I miss this!? The #FishShell is earnestly being rewritten in #Rust *by ridiculousfish himself*: https://github.com/fish-shell/fish-shell/pull/9512

Not sure if it works out, but super excited about it and Andrew Gallant (ripgrep) got involved so it's legit!

The Bean Identity
8 months ago

Anyway, here's my explanation on why we want to port #fishshell to #rust: https://github.com/fish-shell/fish-shell/pull/9512#issuecomment-1410820102

(after the initial PR was a "pull request" PR and not a "press release" PR and, uh, reached an audience we didn't really expect and so the responders lacked some context)

The Bean Identity
8 months ago

The "disco" prompt that ships with #fishshell has a unique feature:

It'll color the current directory differently for each directory.

Precisely, what it does is:

  1. Turn the physical $PWD into a hash
  2. Take that hash, interpret it as an RGB color
  3. Try to see if that color has enough contrast with a (presumed black) background, if not add some
  4. Use that color

So you'll get the same color each time for the same directory, even if you go via a symlink, and it should always be visible on the background.

A demonstration of the above.

A shell session where I cd up a few directories, and then go back, and each directory has the same color both times.

So it has a bit of a rainbow effect.
The Bean Identity
10 months ago

Announcement: I don't do support for #fishshell in private. Don't DM me about it.

Please open an issue or a question on gitter, stack overflow or reddit or whatever, so that

  1. Others also get the chance to handle it, I don't have to (but tbh it's likely I will)
  2. Other people can benefit from the answer

I don't really mind where it is, as long as it's public.

I spend a lot of time on this and I would prefer to use it efficiently. These are my boundaries, please respect them.

(the exception is if I know you personally. friends and mutuals can ask me directly)

Hynek Schlawack
10 months ago

As if there weren't enough great reasons already, TIL #fishShell grew the amazing `path` command in its 3.5 release that is super handy in scripts:

❯ path change-extension md README.rst
README.md

These kinds of string & path manipulations require arcane knowledge in bash / zsh and were always something I had to look up.

✨ You don't have to stick to 1970s shell technology just because you're in a terminal window. ✨

https://fishshell.com/docs/current/cmds/path.html #UNIX

@LovesTha @be I think that's my cue...
Here's how to make #fishshell the default shell in #NixOS:

# /etc/nixos/configuration.nix
{ pkgs, ... }:

{
programs.fish.enable = true;
users.users.<you>.shell = pkgs.fish;

# ... (the rest of your config)
}

The Bean Identity
10 months ago

New #fishshell feature.

Abbreviations can

  1. Be triggered by a regex match
  2. Run a function to transform the token

This means adding ".."/"..."/"...." shortcuts to go up multiple directories can be done in two lines:

function multicd
echo cd (string repeat -n (math (string length -- $argv[1]) - 1) ../)
end

abbr --add dotdot --regex '^\.\.+$' --function multicd

It's in a PR now, but probably going to hit before 3.6.0.

A terminal gif showing me enter the above code.

The I enter ".. " and it turns into "cd ../".

I remove it and enter "... " and it turns into "cd ../../".

I remove it and enter ".... " and it turns into "cd ../../../"

#introduction

I've been a mastodon user since about 2016 and have migrated from @tuck@mastodon.technology. I'm a Staff Software Engineer with Divvy. I'm a #elixir and #rustlang developer professionally and #svelte and #astrocms on the side with a sprinkle of all kinds of other stuff.

I'm interested in #security and #opensource development.

You will also find me posting about #drone flying here and there.

#fishshell #flyfishing #golang #LGRW #redwings #rust to top it all off!

The Bean Identity
4 years ago

Okay, I need to write another #introduction for here, don't I?

Hi, I'm Fabian!

Theoretically, I do unixy computery things that you may or may not care about - the fish shell, some weird tiling script for kwin,...

I also enjoy music - I grew up with metal and blues but am trying to expand. Also videogames.

But in practice, what I do here most of the time is stupid puns, and jeansifying people's avatars.

I'm german but ~98% of my posts are in english.

So:

#fishshell
#metal
#videogames
#puns