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:
Alright, gonna try something different: An actually useful poll!
#fishshell users: Why do you use alias instead of abbr or function?
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
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?
✏️ 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...
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).
@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
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:
curl -s -L cheat.sh/$argv | less -R
Then type: function h cat
The three measures of #fishshell carcinization:
Amount of C++ lines removed:
Amount of SLOC of Rust vs Sloc of C++:
Amount of bytes of Rust vs bytes of C++:
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
I also made the following #FishShell command for it:
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:
argparse h/help s/second -- $argv
if set -ql _flag_help
echo "mybetterfunction [-h|--help] [-s|--second] [ARGUMENT ...]"
if set -ql _flag_second
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?
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 see there's a wrap up on this at https://news.itsfoss.com/fish-shell-rust/
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.
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)
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
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. ✨
New #fishshell feature.
- 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:
echo cd (string repeat -n (math (string length -- $argv) - 1) ../)
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 @firstname.lastname@example.org. 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.
You will also find me posting about #drone flying here and there.
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.