#FishShell
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/
Alright, gonna try something different: An actually useful poll!
#fishshell users: Why do you use alias instead of abbr or function?
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
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
TIL about the `cdh` command in #FishShell
https://fishshell.com/docs/current/cmds/cdh.html
Pretty cool!
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:
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.
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?
💡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...
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).
Long time user of #FishShell, but #NuShell is very tempting!
@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)
#FishShell now supports $(...)
substitutions?! 😮
@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?
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
Wild idea...
Replacing my #fishshell setup with #oilshell + #carapace 🤔
@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!
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
After sticking with #bash forever, I think I'm gonna try switching to #FishShell. Any tips?
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 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%]
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
@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!
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.
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
Statistically, I wouldn't be surprised if most #fishshell installs are on Steam Deck (because it's preinstalled)
"
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
```
Aaand the new and improved https://fishshell.com/ redesign is live!
Get it while it's hot pink!
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
@GPHemsley I am using #FishShell, which has `ll` aliased to `ls -lAh` by default, that's how I found out about it 😅
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.
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)
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"
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)
Turns out the share of Debian systems with #fishshell installed has almost doubled since 2018.
(source)
@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 #fishshell carcinometer of the week:
🦀: [=====> ] 30%
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.
Count The Number of Characters per Filename
https://www.adamsdesk.com/posts/count-characters-per-filename/
#commandline #linux #PowerShell #bash #BusyBox #FishShell #windows
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)
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!
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)
@micahflee y'all need to switch over to #fishshell + fisherman
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:
- Turn the physical $PWD into a hash
- Take that hash, interpret it as an RGB color
- Try to see if that color has enough contrast with a (presumed black) background, if not add some
- 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.
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
- Others also get the chance to handle it, I don't have to (but tbh it's likely I will)
- 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)
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. ✨
@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)
}
New #fishshell feature.
Abbreviations can
- Be triggered by a regex match
- 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.
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!
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: