it's just the worst

379 points · 186 comments · view on lemmy.world

186 Comments

null@piefed.nullspace.lol · 239 pts · 252d (44 replies)

This is bait.

And I'm ready to fish

Fisch@discuss.tchncs.de · 96 pts · 252d (10 replies)

Currently using zsh but I installed fish yesterday to try it out because I'm thinking of switching. All the zsh plugins I have are basically just replicating what fish has by default anyway and fish might do it better.

null@piefed.nullspace.lol · 102 pts · 252d

Plus, look at your name!

joyjoy@lemmy.zip · 33 pts · 252d (5 replies)

Just whatever you do, don't ln -s /bin/fish /bin/sh

Flipper@feddit.org · 4 pts · 252d (3 replies)

Well a shell script that can only run with Nash should include !# bin bash in the header.

exu@feditown.com · 18 pts · 252d (1 reply)

You assume everyone writes shebangs correctly. Also ideally you'd use #!/usr/bin/env bash

Jankatarch@lemmy.world · 11 pts · 251d

I see.
Proceed to write #!/bin/env bash

Ephera@lemmy.ml · 4 pts · 251d

It still gives you basically no advantage compared to just making your terminal emulator launch fish by default. And well, it does give you the major disadvantage that scripts without shebang will fail.

Fisch@discuss.tchncs.de · 1 pts · 240d

Who the fuck would do that 😭

fushuan@lemmy.blahaj.zone · 3 pts · 251d (2 replies)

The other way around, fish was implemented with the most popular zsh plugins in mind.

Fisch@discuss.tchncs.de · 1 pts · 240d

I know but I looked at what fish could do and tried to replicate that with zsh plugins

MrScottyTay@sh.itjust.works · 0 pts · 250d

Six and two threes

flandish@lemmy.world · 28 pts · 252d (21 replies)

what’s fish got? I’m liking zsh here but am always open to a distraction instead of getting work done. :)

null@piefed.nullspace.lol · 40 pts · 252d (20 replies)

Lovely OOTB defaults. I basically change nothing except the theme.

Autocomplete, git context, etc. The QOL stuff you'd expect.

flandish@lemmy.world · 8 pts · 252d (17 replies)

oh interesting. will give it a shot. basically sounds like zsh plus omz?

OhNoMoreLemmy@lemmy.ml · 35 pts · 252d

The main differentiator of fish over everything else is it prioritizes intuitive behavior over backwards compatibility.

Zsh is to bash as c++ is to c. Most bash scripts and habits will work in zsh, but zsh is just more convenient and has more options. Fish is intentionally different.

Do I wish fish had existed instead of bash so we had a nicer terminal experience? On the whole, yes. But I also couldn't be bothered to learn another shell where most of the instructions online won't be able to help you, and I ended up sticking with zsh.

Laser@feddit.org · 14 pts · 252d (4 replies)

Be aware that fish isn't a POSIX-compatible shell enough, so you have to adjust syntax.

rtxn@lemmy.world · 23 pts · 252d (1 reply)

That isn't incorrect, but it's not as important as people make it out to be. Linux isn't certified as POSIX-conformant either.

People are way too stuck on POSIX regarding Fish specifically, but in shell scripting, POSIX compliance boils down to "can it run a pure sh script". Bash is compliant. Zsh is partially compliant and needs to set an option to emulate sh. Fish uses a different syntax and is not compliant; if that is a problem, don't execute sh scripts in Fish.

POSIX compliance for shell scripts was important in the 80s and 90s when the #! directive wasn't as commonly implemented and every script might be executed by the user's $SHELL instead. That is no longer the case as virtually every Unix-like system's program loader supports #!.

Black616Angel@discuss.tchncs.de · 5 pts · 252d

I use fish, but sometimes it acts weird. And lots of "just copy and past this command" kind of online solutions I have to put into bash.

My main irk is when I want to forward a '*' to a program but have to escape it.

exu@feditown.com · 8 pts · 252d (1 reply)

That's why it's a shell for the 90s and not the 80s

Laser@feddit.org · 4 pts · 252d

It's a cool shell, I use it as a daily driver (though I'm keeping a close eye on elvish which syntactically is even further away from classic shell), but the comments read like fish is basically zsh. And while zsh is pretty close to bash, fish isn't.

Pika@sh.itjust.works · 6 pts · 252d (9 replies)

This is a good way of putting it. It's essentially ZSH with Autosuggest/complete and a theming agent. At least visual-wise.

When you get into the scripting and the hot keys aspect of it, they reinvent the wheel and everything is different., Like for example ,!! and other bangs(I think that's the right word?) like that are not valid on fish, And everything to do with variables is different from adding to your path to setting variables to creating functions. Also checking your error code is going to be different as well as it doesn't follow the $x style inputs and doesn't support IFS and globbing works differently.

TLDR; fish is nice, but If you use it unless you want to relearn an entire type of language, keep your scripts on bash or zsh

or if you wanna see the bigger differences fish has a dedicated bash transition page

flandish@lemmy.world · 2 pts · 251d

thanks for the detail!!

Digit@lemmy.wtf · 1 pts · 251d (7 replies)

I never managed to learn bash's ways in my first decade of using it, learning fish a decade ago was easy by comparison. So much more human readable and sensible and consistent. Even though fish is the friendly interactive shell, I now use it for all my scripting too.

Pika@sh.itjust.works · 2 pts · 251d (6 replies)

That was the exact opposite with fish. I had already gotten fairly well first with bash by the time I started using it, and the way fish did it was just super counterintuitive to me.

I couldn't get into the overall design of how it looked and I disliked how command substitution and the built in's worked, Combined with the fact that it's a lesser used shell, so there's less information available on it. I just couldn't do it.

You brought up a point though. That makes me ask. You must not have to share your scripts with anyone then, right? Fish has a very small user base in comparison to ZSH and Bash and when I make a script that's more advanced I tend to want to share it with my friends and having them install a whole new shell just to run a script is just not helpful to me. ZSH is close enough to bash in compatibility that, generally speaking, if I want to share it, I can use zsh And then convert the minor discrepancies. Where with fish I have to redo the entire script.

Digit@lemmy.wtf · 1 pts · 250d

I don't know why small user base is considered as meaning I must not have to share my scripts. Is it like an argumentum populum thing? ["If you build it they will come." ;D]

[I suppose It's true in a strict interpretation of those words... I don't have to.]

I think I have several on my git repos. [... I have even written a text editor in fish.]

Free to use for anyone who wants to.

Also, if user base size is a concern, Fish's user base is growing faster than Bash or ZSH.

Installing another shell seems a trivial matter to run something.

I install far bigger languages for far less all the time.

And conversion [if for some edge case reason you really need to ~ I know not why though] is generally trivial these days... just ask an LLM, if conversion scripts are lacking.

As for the less information about it... the online help's really rather thorough and accessible.

I don't know that quantity over quality would help. It didn't for me and bash.

Unless I missed something, it seems to me that all that remains, is

I disliked

And that's of course utterly fine. Free software's defining point zero, the freedom to use software, includes the freedom to not use. Good to have multiple options to further facilitate that first freedom, catering to more variety of tastes.

null@piefed.nullspace.lol · 2 pts · 252d

Yup, very similar! And quite customizable as well if you want to. But the focus is on having, by default, a friendly interactive shell.

I like that I can spin up a VM, install fish, chsh and I'm all set.

ark3@lemmy.dbzer0.com · 4 pts · 252d (1 reply)

does fish have fuzzy reverse hostory search?

null@piefed.nullspace.lol · 7 pts · 252d

Looks like that is indeed the default option

KSPAtlas@sopuli.xyz · 8 pts · 251d (1 reply)

It's time for a nushell

Johnmannesca@lemmy.world · 1 pts · 248d

Misread it as nutshell

prole@lemmy.blahaj.zone · 5 pts · 252d (7 replies)

Fish is great if you can't remember a specific command, or don't want to type out long filenames/locations, but I dunno if I'd use it as the default.

I just type "fish" in the terminal if I ever run into a situation where I might get some use from it.

null@piefed.nullspace.lol · 9 pts · 252d (3 replies)

I used to do that, until I realized I never had a usecase for plain bash over fish

Ephera@lemmy.ml · 3 pts · 251d (2 replies)

I have that occasionally when I want to copy a complex bash command from somewhere. But yeah, I can then just run bash, run the command in there and then exit back out of there.

1rre@discuss.tchncs.de · 2 pts · 251d (1 reply)

that's what bass is for

Ephera@lemmy.ml · 2 pts · 251d

I'm guessing, you mean this then: https://github.com/edc/bass

But well, I was rather thinking of when it's using Bash-scripting-syntax to combine multiple commands.
Like, maybe there's a for-loop in there. You just can't paste that directly into Fish and have it work. Granted, you should probably put that into a script file, even if you're using Bash, but yeah, just temporarily launching bash is also an option.

Digit@lemmy.wtf · 2 pts · 251d (2 replies)

in my ~/.bashrc

# if interactive, launch fish
[[ $- != *i* ]] && return || fish

and

alias f='fish'

So fish is my default, and if I ever need bash, it's already there underneath, just a Ctrl-d keybind away to fall back on, and if I want to get back into fish, it's just a f & RETURN away.

Seems better to have all the convenience of fish up front. All the completion magic. I so rarely have to type much at all.

PM_me_your_doggo@lemmy.world · 1 pts · 250d (1 reply)

Why not just set it as the default then?

Digit@lemmy.wtf · 1 pts · 250d

Can cause issues (with things that expect bash or other nearer POSIX compliant shells as the system shell).

And then I'd lose those other benefits described, like having bash just a keybind away.

[Edit: I could have swore I got that interactive check in bashrc thing from https://fishshell.com/docs/current/faq.html or other documentation on fishshell.com, but, seems not. Can't find it even in older copies. Not sure where I picked up that idea from then. Plausibly from someone on irc. I was sure I got that as official advice from fish... which I've been using and doing that method with since around 2014.]

inzen@lemmy.world · 1 pts · 251d

I jumped from bash to fish because cachy os has it as default. I kinda don't like it, it's a little too fancy, but it's not bad enough for me to bother switching the default to bash. So I'm using it. Still not quite liking it but maybe it's growing on me.

db0@lemmy.dbzer0.com · 83 pts · 252d (35 replies)

Am I out of the loop? what's wrong with zsh?

three@lemmy.zip · 126 pts · 252d (10 replies)

Classic linux tribalism. Use what you like and don't get involved with these confrontational nerds.

db0@lemmy.dbzer0.com · 15 pts · 252d (8 replies)

I mean, there's some things that became validly toxic due to their developers, example off the top of my head: Reiserfs

three@lemmy.zip · 13 pts · 252d (3 replies)

True, software can call you a slur.

RickyRigatoni@retrolemmy.com · 12 pts · 252d

It can when I write it.

W98BSoD@lemmy.dbzer0.com · 4 pts · 252d

Or kill your mail order Russian wife.

db0@lemmy.dbzer0.com · 3 pts · 252d

wat?

irelephant@lemmy.dbzer0.com · 2 pts · 252d (1 reply)
[ removed ]
db0@lemmy.dbzer0.com · 2 pts · 251d

Inserts joke about it being weird that it happened twice

raptore39@lemmy.ca · 1 pts · 251d (1 reply)

Are you referring to the creator of Reiserfs killing his wife and burying her in a shallow grave near their home?

db0@lemmy.dbzer0.com · 1 pts · 251d

What else could I possibly be referring to?

pimento64@sopuli.xyz · -6 pts · 252d

There doesn't have to be tribalism, people just need to accept that systemd is a botnet

grue@lemmy.world · 32 pts · 252d (13 replies)

It's permissively-licensed (as opposed to bash, which is GPLv3). Pushing zsh over bash is part of a larger effort by corporations to marginalize copyleft so they can more easily exploit Free Software at the users' expense. Don't fall for it!

FishFace@piefed.social · 5 pts · 252d (9 replies)

It's such a shame that, if zsh gains enough critical mass, all copies of its source code will be deleted from the universe and no-one will be able to use it without paying any more.

grue@lemmy.world · 12 pts · 252d (8 replies)

It's such a shame that you can't customize the version of zsh running on your Linux-based embedded device because it's DRM'd to prevent the modified version from being installed.

...oh wait, that's not sarcasm because it's actually plausible.

FishFace@piefed.social · 5 pts · 252d (4 replies)

Cool.

And what, exactly, is the path from "pushing back on zsh" to "embedded device manufacturers can no longer lock down their devices?"

Shrubbery@piefed.social · 6 pts · 252d (3 replies)

A plausible path is precedent and normalization, not zsh specifically.

If a widely used copyleft component (like a shell) starts being accepted as “OK to lock down” in consumer or embedded devices, manufacturers and courts get comfortable with the idea that user-modifiable software is optional rather than a right tied to distribution. Over time, that erodes enforcement of anti-tivoization principles and weakens the practical force of copyleft licenses across the stack.

Once that norm shifts, vendors can apply the same logic to kernels, drivers, bootloaders, and userland as a whole—at which point locked-down embedded devices stop being the exception and become the default, even when the software is nominally open source.

FishFace@piefed.social · 2 pts · 251d (2 replies)

I don't understand. It's already ok to "lock down" devices, from the point of view of most consumers and the courts, regardless of the software license. Phones make it hard for you to flash new firmware onto them. That is still true with android and the open source components in its stack.

Using bsd licensed software in every day life cannot accelerate that because it has already happened, and I don't see how it would be otherwise, because software licensing doesn't protect against the kind of locking down you're talking about.

Shrubbery@piefed.social · 0 pts · 250d

"The single raindrop never feels responsible for the flood." - Douglas Adams

thesmokingman@programming.dev · 1 pts · 251d (2 replies)

Shit I didn’t know this was a problem. What devices are these? I’m assuming we’ve got a few in every home?

namingthingsiseasy@programming.dev · 6 pts · 251d (1 reply)

It's called tivoization and started with a device called "Tivo" which was the first of its kind to attempt this procedure.

There are probably lots of hardware devices in your house that use GPL software but prevent you from actually modifying it because the hardware will refuse to run modified copies. If a piece of software is licensed GPLv3, it would violate the license terms to do something like this.

thesmokingman@programming.dev · 1 pts · 251d

Yes but we’re talking about zsh. I know zsh wasn’t on TiVo.

F04118F@feddit.nl · 5 pts · 251d
srestegosaurio@lemmy.dbzer0.com · 2 pts · 251d

Come one, free software aside bash UX is terrible. Not everything is a conspiracy.

fushuan@lemmy.blahaj.zone · 1 pts · 251d

But bash doesn't have p10k. Sorry not sorry.

fuckwit_mcbumcrumble@lemmy.dbzer0.com · 9 pts · 252d

It’s stinky and smelly and smells bad.

SomethingBurger@jlai.lu · 8 pts · 252d

Same as systemd, PipeWire, Wayland, Flatpak... basically, it's new therefore it is bad.

irelephant@lemmy.dbzer0.com · 4 pts · 252d
[ removed ]
ZoteTheMighty@lemmy.zip · 2 pts · 251d

It's better.

ErenOnizuka@lemmy.dbzer0.com · 2 pts · 251d (2 replies)

Unrelated to the topic: How did you make your username red?

db0@lemmy.dbzer0.com · 3 pts · 251d (1 reply)

I didn't, depending on your client it might be how it signifies instance admins

ErenOnizuka@lemmy.dbzer0.com · 2 pts · 251d

Thx.

AllNewTypeFace@leminal.space · 1 pts · 251d (1 reply)

RMS doesn’t approve

laurelraven@lemmy.zip · 4 pts · 251d

They asked what's wrong

ExLisper@lemmy.curiana.net · 1 pts · 252d

It makes people vomit.

umbrella@lemmy.ml · 64 pts · 251d (5 replies)
[ removed ]
DieserTypMatthias@lemmy.ml · 15 pts · 251d

It's actually windows

It's actually not Unix-like.

Tangent5280@lemmy.world · 12 pts · 251d

Search for whatever passes for a terminal in microslop machine

Top result is Terminal from 2018

As far as I can tell it is some kind of action thriller movie?

0/10 garbage experience

Movie was terrible also

Jankatarch@lemmy.world · 2 pts · 250d (1 reply)

Kind reminder that powershell has OOP.

Amir@lemmy.ml · 2 pts · 250d

I spent 5 minutes reading this and the further I get the more I hate it

ChaoticNeutralCzech@feddit.org · 2 pts · 250d
C:\WINDOWS\system32>echo $0
$0

C:\WINDOWS\system32>

In Powershell, it exits with no output

natecox@programming.dev · 59 pts · 252d (4 replies)

Oh yay, more tribalism.

kadu@scribe.disroot.org · 35 pts · 252d (1 reply)

Yay? Everybody knows you should use paru! /s

FEIN@lemmy.world · 4 pts · 251d

lmfao beautifully executed

Tangent5280@lemmy.world · 4 pts · 251d (1 reply)

I am a pureblood and do all the computing I need in my head.

Digit@lemmy.wtf · 2 pts · 251d

Real sysadmins use butterflies.

IrateAnteater@sh.itjust.works · 35 pts · 252d (21 replies)

I switched from bash to zsh a while ago, mostly just for shits and giggles. I really can't see any reason to form a strong opinion on it one way or the other.

grue@lemmy.world · 30 pts · 252d (14 replies)

Bash is copyleft (GPLv3). Zsh is permissively-licensed.

Apple, for instance, switched from bash to zsh when the GPL version upgraded because they wanted to withhold those rights from their users.

Zsh should be considered harmful as a tool of corporate encroachment and subjugation of Free Software.

db2@lemmy.world · 29 pts · 252d (13 replies)

Calm down RMS, you're going to have another episode.

drkt@scribe.disroot.org · 28 pts · 252d (12 replies)

His episodes are just him being right over and over and us refusing to listen

SomethingBurger@jlai.lu · 16 pts · 252d (1 reply)

He is always right.

Except for that one time.

AllNewTypeFace@leminal.space · 3 pts · 251d

He should be awarded a prize for services to womens’ horticulture, given the number of women at MIT who filled their offices with houseplants just to keep him away.

natecox@programming.dev · 7 pts · 252d (8 replies)
[ removed ]
grue@lemmy.world · 2 pts · 252d (7 replies)
[ removed ]
natecox@programming.dev · 0 pts · 252d (6 replies)
[ removed ]
grue@lemmy.world · 0 pts · 252d
[ removed ]
null@piefed.nullspace.lol · 7 pts · 252d

Well and also eating his own feet

Pika@sh.itjust.works · 4 pts · 252d (2 replies)

I went from bash to fish to zsh. I can see why people would like having fish as a shell. but I hated scripting on it and if I'm going to be triggering a different shell for scripts anyway, I might as well skip the middleman, not re-invent the wheel and just use zsh with plug-ins that way I only have two shells installed instead of three. Adding the auto-complete plugin and a theme plugin for zsh gives most of fishes base functionality and design while making it so I don't need to worry about compatibility.

Maybe someday when I'm less code oriented, I will re-look at fish, but I don't see it happening in the foreseeable future.

Digit@lemmy.wtf · 1 pts · 251d (1 reply)

Heh. I script nearly everything in fish now, because it's way more expedient and readable. [At first I didn't, just thought its advantages are interactive. Better scripting snuck up on me.]

Wouldnt ZSH be the wasted middle in your analogy?

Fish wheel already invented, no contrived middle.

Pika@sh.itjust.works · 1 pts · 251d

zsh actually predates fish by almost 15 years and bash which 16 years while fish shell also ignores every standard known in favor of doing it's own thing so yes I would say it's re-inventing the wheel.

Fish is known as what's called an exotic shell, meaning that it doesn't adhere to what is considered standard for Linux systems, which would be POSIX compliance. Now most alternative shells have partial compliance, not full compliance. But fish didn't have any compliance. It didn't attempt it. Like you mentioned, its use case was meant to be an interactive shell. So scripting on it was a back burner project.

If it works for you, then that's good. I tried it, hated the lack of information available for it, and hated the way that it didn't follow standards. And at the end of the day, anything I made for it was exclusively for me due to the fact that I could no longer share configurations or chains with anyone else because they did not have fish shell. I'm sure it works for some but it didn't fit my use case anywhere

ImgurRefugee114@reddthat.com · 3 pts · 252d

If you wanna try something different, give nushell a try. It's like magic to me.

6nk06@sh.itjust.works · 2 pts · 252d

I don't have an opinion either but you could try using Starship on top of ZSH:

It's supposedly lighter than OhMyZSH with the same features.

Starship is also available with other shells, and even Powershell which is nice because having the same tool everywhere is always better.

jollyrogue@lemmy.ml · 1 pts · 251d

Zsh is but more for interactivity. The extended file globbing, extended auto completion, and loadable modules are the main reasons I like it. The features really shine when used with a configuration framework like ohmyzsh.

Supposedly, Zsh has a more comprehensive shell scripting syntax, but that’s not a plus since I don’t want to write shell scripts.

mlg@lemmy.world · 30 pts · 251d (15 replies)

Default zsh is just bash, you need to add all the fancy plugins to get it to do cool stuff

fish is for people who don't want to spend the time setting it all up and to just get a shell that has most of the QoL fetaures builtin.

Tangent5280@lemmy.world · 18 pts · 251d (6 replies)

But I'm a compliant little bitch for POSIX daddy

Quantenteilchen@discuss.tchncs.de · 10 pts · 251d (2 replies)

So write all your scripts in POSIX compliant bash and use the proper shebang?

Azzu@lemmy.dbzer0.com · 5 pts · 251d (1 reply)

You don't even need a proper shebang. Scripts without shebang are executed in bash by fish.

Nalivai@lemmy.world · 1 pts · 250d

Which is also isn't POSIX compliant I think

daggermoon@lemmy.world · 2 pts · 251d (2 replies)

I tried switching to Nushell but certain things just wouldn't work so I switched back to zsh. sha512sum wouldn't work and there's no native replacement.

crater2150@feddit.org · 3 pts · 250d (1 reply)

Isn't sha512sum a regular binary, that should not depend on the shell at all? What does nushell do that something like that can break o.O

daggermoon@lemmy.world · 1 pts · 250d

Probably. I think it had something to do with how it's invoked in Nushell. I think it requires typing something different than what I'm used to. I searched it up and couldn't find an answer and got pissed off and went back to Zsh. I'm not blaming Nushell, it's just not for me. Nushell does have it's own binaries for sha256 and md5, but I prefer sha512 even though it literally doesn't matter for my use case.

Nalivai@lemmy.world · 10 pts · 251d (7 replies)

Fish is for people who like it when sometimes scripts don't work

Azzu@lemmy.dbzer0.com · 4 pts · 251d (5 replies)

Why would sometimes scripts not work? All scripts are executed with bash by default.

floquant@lemmy.dbzer0.com · 12 pts · 251d (4 replies)

No, they are executed according to the shebang on the first line, which is usually bash. If it is missing, it will default to the current shell.

Azzu@lemmy.dbzer0.com · 5 pts · 250d (1 reply)

That's true, but I definitely use fish as my default shell and when it runs a script without shebang it automatically runs it with bash. Thus I assume that's the fish default to make your scripts work.

floquant@lemmy.dbzer0.com · 1 pts · 250d

Trying to be more POSIX-compatible by further breaking POSIX spec is an ok choice to make in this case imo, but I think that's a somewhat important detail to know :)

pupbiru@aussie.zone · 4 pts · 250d (1 reply)

what kind of monster writes a script without a shebang?

Nalivai@lemmy.world · 1 pts · 250d

The situation when people go on stackoverflow and just grab some shit from the top answer and just copy paste in their console is surprisingly normal. Not me, obviously, but like other people do it all the time.

evol@lemmy.today · 2 pts · 251d

I like to gamble what can i say

CrypticCoffee@lemmy.ml · 28 pts · 251d

A 4chaner has friends? Fake nerd copium.

yardratianSoma@lemmy.ca · 27 pts · 251d (16 replies)

I have never really ever used bash and thought, "Man, I wish my shell was better . . . ". Using ctrl+r to recall past commands, using sudo !! to fix missing permissions and writing small bash scripts all work very well.

That being said, if you use anything else, and you like it, I'm happy for you, but I do wonder, what leads people to other shells? What problems do they have with bash?

Ephera@lemmy.ml · 16 pts · 251d (8 replies)

To me, it genuinely makes a huge difference that I don't have to manually press Ctrl+R for history search. Because 9 times out of 10, I accept a history suggestion from Fish where I did not think about whether it would be in my history.

This includes really mundane commands, like cd some/deeply/nested/path/. You would not believe, how often I want to cd into the same directory.
But I've also had it where I started typing a complicated docker run command and Fish suggests the exact command I want to write, because apparently I already ran that exact command months ago and simply forgot.

astro@leminal.space · 12 pts · 251d (6 replies)
[ removed ]
ben@feddit.dk · 1 pts · 251d (5 replies)

Do you know if fish can input arguments from prevous commands like ESC + . does in bash?

astro@leminal.space · 2 pts · 246d (1 reply)
[ removed ]
ben@feddit.dk · 1 pts · 244d

Now i can up and down. Thanks for the info!

Digit@lemmy.wtf · 2 pts · 251d (2 replies)

Do you know if fish can input arguments from prevous commands like ESC + . does in bash?

Like Alt-.? (/ Alt - > ).

Easier in reach, and can cycle through.

I've not got that in my muscle memory yet... so rarely used... had to look that up. Handy. Should use more.

ben@feddit.dk · 1 pts · 251d (1 reply)

Yes exactly. I couldn't find it on the fish online docs. Alt-. apparently also work in bash, so i should just not use the ESC version. I use it a lot for renaming and moving files. Thanks.

Digit@lemmy.wtf · 1 pts · 250d

Hrm. Couldn't find it on the fish online docs, ey? Worth a mention to https://github.com/fish-shell/fish-shell/issues ?

Digit@lemmy.wtf · 2 pts · 251d

Yep, and fish has even more ways to expedite frequent used commands and locations, but because the completion stuff's so good, it's easy to never bother setting up abbreviations and keybinds and so on. So many things are often just a couple key presses away, by default, after using it for a while.

Ledivin@lemmy.world · 12 pts · 251d (2 replies)

alias fuck='sudo !!' is probably the best thing I've ever added to my profile

Gumus@lemmy.dbzer0.com · 4 pts · 251d (1 reply)
Ledivin@lemmy.world · 1 pts · 251d

The heavy-handedness of that absolutely terrifies me, but at least it asks for confirmation first.

baguettefish@discuss.tchncs.de · 5 pts · 251d

i use bash but i also use atuin which makes shell history so much neater. that's about the only convenience i need in a terminal shell.

phaedrus@piefed.world · 3 pts · 251d

I script everything in bash, but for everyday use fish just has some modern QoL things that make it easier to get around. For me, specifically, it's the way you can recall commands by seeing a ghost version of your history, as you type. You can even scroll through a filtered history if you're part-way through typing some long command that matches what you have typed.

Another neat thing, it does it's best to predict what I want to type and remembers common locations, showing them as ghost text as well.

crater2150@feddit.org · 3 pts · 250d

I switched to zsh at a time where completion for commands parameters except file paths in bash wasn't really a thing, you could add some with a script, but they didn't work well. I'm sure the situation has improved by now, but someone told me recently, there are still no descriptions for the completions. I find it very helpful and it saves me opening a man page a lot of times. For example, typing grep -<Tab> gives me this: 8167

And now I'm so used to many little features (mostly around the syntax) that wouldn't be a reason to switch on their own, that I find bash cumbersome to use.

Digit@lemmy.wtf · 2 pts · 251d

Try fish for a week, use the online help to familiarise with the completion stuff... see if you still find bash adequate.

Chaser@lemmy.zip · 26 pts · 251d (2 replies)

zsh > bash

Tangent5280@lemmy.world · 17 pts · 251d (1 reply)

Brave stand, I will stand side by side with you until the first signs of mild resistance or mockery from the world!

ulterno@programming.dev · 7 pts · 251d

Well guess what?

#include <string.h>
#include <iostream>

int main (int argc, char *argv[])
{
	const int which = strcmp ("zsh", "bash");
	std::cout << which << std::endl;
	return 0;
}

Output
1

LiveLM@lemmy.zip · 19 pts · 251d (2 replies)

Me hitting tab on any shell that isn't fish

phaedrus@piefed.world · 4 pts · 251d

"What the hell was that I ran the other day?"

start typing, ctrl+right, up, up, up, up, up, up

"Gotcha, bastard!"

right, enter

jenesaisquoi@feddit.org · 1 pts · 251d

🦀

ashestoashes@lemmy.blahaj.zone · 15 pts · 252d

bait used to be believable

juipeltje@lemmy.world · 14 pts · 252d (5 replies)

I never tried anything other than bash tbh. Not sure if i should. I never really looked into what i might be missing out on with a different shell. Bash just works so i never felt like messing around with it.

texture@lemmy.world · 17 pts · 252d (1 reply)

fish is worth trying. saves alot of typing

Digit@lemmy.wtf · 1 pts · 251d

So true.

Save the RSI spoons for the real work. Don't waste them on the shell. Get more done, with less pain, less effort, faster.

InFerNo@lemmy.ml · 1 pts · 251d (2 replies)

If you ever used ubuntu, then you've used dash

crater2150@feddit.org · 1 pts · 250d

I thought the default interactive shell is still bash on Ubuntu, dash is only used for /bin/sh, isn't it? At least bash is also installed by default, as there are so many scripts that wouldn't run otherwise

juipeltje@lemmy.world · 1 pts · 251d

Hmm, i didn't know ubuntu was using a different shell. I've used it a few times in a vm. Other than that i installed it on my laptop once like 15 years ago lol.

callyral@pawb.social · 13 pts · 252d (2 replies)

I use zsh and it's fine, I use it with starship, zsh-syntax-highlighting and zsh-autosuggestions

pineapplelover@lemmy.dbzer0.com · 4 pts · 252d (1 reply)

You can do that with fish too and it's easier to do so

callyral@pawb.social · 6 pts · 251d

Yes, I replicated some features of fish in zsh because I liked some parts of fish but I didn't like the different syntax (not that I'm too familiar with the shell, just familiar enough to get annoyed sometimes when using fish).

specialwall@midwest.social · 10 pts · 251d (3 replies)

What specifically do you dislike about zsh?

kali_fornication@lemmy.world · 5 pts · 251d

tbh it's fine and i use it a lot more than bash.

uid0gid0@lemmy.world · 2 pts · 250d (1 reply)

It's the index on 1 that ruins it for me.
Edit: come to think of it what would zsh print out for echo $0?

rtxn@lemmy.world · 1 pts · 250d

It follows the same convention as most programming languages that expose the argument list. Python's sys.argv has the program name at index 0 and the first argument at index 1. C's char **argv does the same: index 0 is the program name, index 1 is the first argument. So it stands to reason that Zsh's $0 should be the program name and $1 should be the first argument...

...which, by the way, is exactly what Bash does as well.

muusemuuse@sh.itjust.works · 10 pts · 251d

I literally do not notice any difference. If the folders and such get the pretty colors and tab works, I could give a damn.

iamthetot@piefed.ca · 6 pts · 251d

I use whatever my OS came with.

ErenOnizuka@lemmy.dbzer0.com · 6 pts · 251d (9 replies)

Linux noob here. Can you explain please why I‘d use a different terminal than what my distro provides (bash)?

LorIps@lemmy.world · 21 pts · 251d (6 replies)

I would really recommend you try fish.

It has a lot of nice autocomplete features and handles functions much better than bash. It has a very sensible autoconfig so you can just install and try it.

Zsh can be configured in quite a lot of ways. It's default config is quite similar to bash.

ErenOnizuka@lemmy.dbzer0.com · 6 pts · 251d (5 replies)

What does it autocomplete? Filenames? Bash can do that too, right? I just hit the tab key and it’s written there.

And with functions you mean in scripts? How does it handle functions better?

LorIps@lemmy.world · 6 pts · 251d (4 replies)

Autocompletions in fish also take history into account, which saves you a lot of typing in the long run.

Fish shell script is much more sensibly constructed than bash so it's just much easier to write a script in fish.

voodooattack@lemmy.world · 3 pts · 251d (2 replies)

Fish was amazing when I first discovered it, but I found it had too many problems for me to effectively use it. Having to adapt existing bash/zsh scripts was a major problem for me.

So I went the other way around and managed to get all of the Fish features I wanted working under zsh using atuin, starship, and other misc. oh-my-zsh plugins to fill the gaps.

Best part: I used a git-controlled home-manager setup to do it so I can activate my entire environment on a fresh machine/server in minutes after I clone it.

Digit@lemmy.wtf · 2 pts · 251d (1 reply)

Why bother adapting existing scripts?

They're happy running as they are in bash/zsh.

voodooattack@lemmy.world · 1 pts · 251d

They were mine. People rice their DEs, which I don’t care much about tbh… but I rice my shell even more obsessively.

ErenOnizuka@lemmy.dbzer0.com · 3 pts · 251d

Thank you for explaining

TheTimeKnife@lemmy.world · 6 pts · 251d

Features and default settings, but its really just about preference. They are all good at what they do.

Also im only saying this because it confused me for so long, but shell and terminal are different parts of the same thing. Bash is your shell, its the backend that runs everything you type into your terminal. My computer for example uses my kitty terminal which communicates in bash. You can change both the shell and terminal. Zsh is another shell, so it would change the "shell language" you use to communicate with your terminal.

kartoffelsaft@programming.dev · 4 pts · 251d

There can be a ton of reasons, albeit I personally also just stick with default (for me zsh). In typical linux user fashion I also must tell you that bash and zsh are shells, not terminals.

The two main reasons you'd choose a particular shell is because you prefer it's configurability or syntax. Zsh has a bunch of features that you can enable and you can configure it to behave basically however you want, like adding spelling correction or multiline editing, but it's defaults absolutely suck unless your distro comes with a sensible config. Fish, which another guy here's raved about, goes in basically the opposite direction and is really nice to use out of the box (I haven't used it though). I hear it's technically not a valid /bin/sh substitute like zsh or bash because of syntactic differences, but that'd be a whole other rabbit hole if true.

One other reason can be performance concerns because bash is pretty slow when treated as a programming language, but I'd argue you shouldn't organize your workflow so that bash is a performance bottleneck.

zen@lemmy.zip · 6 pts · 251d

I don't mind /bin/zsh.

Now Oh My Zsh! on the other hand can die in a hole.

greedytacothief@lemmy.dbzer0.com · 5 pts · 251d (1 reply)

Usually I just use bash it's definitely good enough. I've tried zsh and fish, I definitely prefer fish

Digit@lemmy.wtf · 2 pts · 251d

I hear ZSH can be made as nice as fish (or near enough (~?)), but I've just never bothered since fish is nice straight out of the box.

pseudo@jlai.lu · 4 pts · 251d (4 replies)

I'm not tring that on my machine. What does it does?

boonhet@sopuli.xyz · 12 pts · 251d (3 replies)

Prints out what shell you're using. Bash is default for most Linux distros. MacOS switched from bash to zsh as their default. Zsh is hella customizable, by default it functions more or less like bash.

Fish is cool, has neat quality of life features out of the box, but can also break scripts sometimes.

pseudo@jlai.lu · 6 pts · 251d

Thank you. TIL.

SolarBoy@slrpnk.net · 5 pts · 250d

For me it does not seem to print anything

I'm using fish, which is great :)

thethunderwolf@lemmy.dbzer0.com · 3 pts · 250d

Good scripts don't break in other shells, they use a shebang

db2@lemmy.world · 3 pts · 252d

What about ksh?

halvar@lemy.lol · 3 pts · 252d

but but but easy to theme

RoyaltyInTraining@lemmy.world · 2 pts · 251d

Fish was kinda cool when I tried it, but I don't really care about the benefits that much. I love Zsh's effortless customization with Oh My Zsh and the POSIX compatibility.

srestegosaurio@lemmy.dbzer0.com · 2 pts · 250d

Nushell is very cozy for me. I work with SQL all day so I ended with PTSD and having my terminal syntax cosplay as it is nice.

WorldsDumbestMan@lemmy.today · 1 pts · 251d (2 replies)

I....I don't understand the meme? I have some Termux LXqT OS

phaedrus@piefed.world · 2 pts · 251d (1 reply)

zsh is just a fancy shell with its own scripting language, and like anything in Linux-land all variations on a theme must be at war with each other! Kinda like Vim vs eMacs.

WorldsDumbestMan@lemmy.today · 1 pts · 251d

Hey! I use Vim :D

Jankatarch@lemmy.world · 1 pts · 250d
[ removed ]
Treczoks@lemmy.world · 1 pts · 250d

Zsh? That's a command shell I have not heard of for a very long time.

Check the date on his computer, is it also set to something in the 1980s?

MehBlah@lemmy.world · 0 pts · 251d (2 replies)

/bin/bash and move on with your life.

Edit: Oh no one is looking for a solution. I see.

iknowitwheniseeit@lemmynsfw.com · 1 pts · 250d (1 reply)

I think macOS defaults to zsh now?

MehBlah@lemmy.world · 1 pts · 250d

Wouldn't know. I have 15 macs I have to maintain at work and I don't use them. I prefer a real computer.