helloSystem / hello

Desktop system for creators with a focus on simplicity, elegance, and usability. Based on FreeBSD. Less, but better!
2.3k stars 57 forks source link

fish instead of zsh? #56

Closed gabescarbrough closed 2 years ago

gabescarbrough commented 3 years ago

I'm curious why zsh was chosen as the default shell. Since tcsh is the default for FreeBSD it seems like it was a conscious choice. I was able to track down the commit where you switched from bash but there wasn't any info why in the commit message.

While I really like zsh - it is actually the main shell I use at work - I've grown fond of fish due to how much it gives you out of the box without something like ohmyzsh. When Apple switched their default shell to zsh I couldn't help thinking that fish feels a lot more like "it just works."

If there is an attachment to zsh, for instance to keep more compatible with bash/sh, thoughts on providing better defaults? Features like autocomplete, color coding, etc. are pretty nice and make the terminal feel more approachable.

probonopd commented 3 years ago

Hi @gabescarbrough thanks for your thoughts. I had ran a survey:

https://twitter.com/probonopd/status/1329129763357724673

As someone correctly commented, many in the helloSystem target audience won't ever use a shell, and those who do can probably easily install another one from pkg.

gabescarbrough commented 3 years ago

I guess it depends on how you want it to behave. I find fish's defaults approachable out of the box for interactive use. Sure, it's not POSIX compatible but if I wanted to write a shell script I was expecting to share I would use sh.

I do agree most users in the target audience don't use the shell but I also think part of the reason why is because it feels unapproachable as they are trying bash which lacks the level of autocomplete, suggestions, color coding, etc. that fish has out of the box.

Thoughts on better defaults for zsh? Such as some of the plugins @bb010g mentioned? Would be happy to open a PR and you can veto anything you think doesn't fit the helloSystem ethos.

probonopd commented 3 years ago

When I experimented with fish I hit backspace and it deleted whole words. Is this how it is intended to be? I am open to experimentation, as long as it doesn't totally break existing habits of someone coming from (unfortunately?) a bash dominated world.

gabescarbrough commented 3 years ago

When I experimented with fish I hit backspace and it deleted whole words. Is this how it is intended to be?

I've never experiences that particular issue. I just installed fish on hello and got the normal "delete one character" backspace behavior.

0mp commented 3 years ago

Hi! I’d like to give a bit more insight regrading shells from the FreeBSD project point of view.

Currently, FreeBSD ships two shells, sh(1) and tcsh(1). sh is meant to be a scripting shell, however, it has grown various features over the years to make it a bit more friendly for interactive sessions. tcsh on the other hand is the current interactive shell.

The idea of importing a new shell into the FreeBSD base pops up on project’s mailing lists regularly (at least once a year I’d say, usually leading to excessive bikeshedding). Although the community generally agrees that it would be nice to have an interactive shell with Bourne-shell-compatible syntax in base (like Bash, Zsh, or mksh), there is no clear consensus on which shell to import (or even whether to do it at all). Especially, when 1. user’s favorite shell is usually just one pkg install away and 2. packaged base system is just around the corner.

Personally, I have no preferences whether helloSystem is going to set the default a shell to something else than sh or tcsh. However, I would like to encourage you to give a heads-up to the FreeBSD community if you decide to go for a non-standard shell. It may end up being an important voice in the discussion on a new shell in the base system.

Cheers & good luck with helloSystem 👍

probonopd commented 3 years ago

Hello @0mp and thanks for chiming in. helloSystem doesn't want to deviate from FreeBSD standards if it can be avoided For example, we don't build our own kernel or packages (as some of the other Live system projects do).

/bin/sh for scripting is a given to maintain compatibility with existing scripts.

As for the interactive shell, since helloSystem wants to be "welcoming to switchers from the Mac" and the Mac uses zsh, we are currently setting it as the default. But I don't feel strongly about it, because the shell will only be seen by "power users" anyway, which can easily change it. So if you think the FreeBSD community would prefer tcsh, then we could use that as the default indeed.

0mp commented 3 years ago

Hello @0mp and thanks for chiming in. helloSystem doesn't want to deviate from FreeBSD standards if it can be avoided For example, we don't build our own kernel or packages (as some of the other Live system projects do).

/bin/sh for scripting is a given to maintain compatibility with existing scripts.

As for the interactive shell, since helloSystem wants to be "welcoming to switchers from the Mac" and the Mac uses zsh, we are currently setting it as the default.

Makes perfect sense.

But I don't feel strongly about it, because the shell will only be seen by "power users" anyway, which can easily change it. So if you think the FreeBSD community would prefer tcsh, then we could use that as the default indeed.

I think that Zsh is perfectly fine. I'll mention helloSystem next time we'll have a discussion about a new shell in the base system. Cheers!

grahamperrin commented 3 years ago

I understand the appeal of fish, however after being with FreeBSD-CURRENT for so long: I find it slightly weird when (for example) I occasionally dip into NomadBSD or GhostBSD. I know, I can search the Internet to remind myself how to change my default shell, but I never remember such things.

I was a Mac user for more than two decades, command line familiarity made it reasonably easy for me to switch (from Mavericks) … I wasn't sure what I used in Mavericks but re: https://en.wikipedia.org/wiki/Z_shell I assume that it was bash.

Also re: the Wikipedia page, I wasn't aware of Catalina adopting the Z shell. A fair proportion of Mac users should enjoy finding the same default in helloSystem.

I'll install zsh this morning, remind myself what it's like.

grahamperrin commented 3 years ago

https://github.com/helloSystem/hello/issues/56#issuecomment-747710175

… packaged base system is just around the corner. …

Oh, that's interesting. Thanks. From something that I recently read (in the TrueNAS area?) plus the absence of an ETA (speed reading the foot of https://wiki.freebsd.org/PkgBase) I imagined that interest had waned/stalled. Interesting but OT; I'll be in IRC, for anyone who'd like to discuss.

probonopd commented 3 years ago

packaged base system

What I am missing is a clear description of its advantages. E.g., "Reduce the size of the base system by up to 50%". So far, what I really like about FreeBSD is that it gives you a set of tools that you can assume to be "just there" on every system, and I fear that a packaged base system might water this advantage down?

grahamperrin commented 3 years ago

https://github.com/helloSystem/hello/issues/56#issue-764853865

… Features like autocomplete, …

Control-R in zsh thanks to sysutils/mcfly:

image

Four keystrokes later:

image

igalic commented 3 years ago

packaged base system

What I am missing is a clear description of its advantages. E.g., "Reduce the size of the base system by up to 50%". So far, what I really like about FreeBSD is that it gives you a set of tools that you can assume to be "just there" on every system, and I fear that a packaged base system might water this advantage down?

chiming in as the creator of https://alpha.pkgbase.live/

i think the main advantage of PkgBase is the speed of which updates can be installed on a system.

since helloSystem is for now primarily a live ISO that's of no concern — to the user.

and since it's probably built from the latest patch version of whatever stable and/or current enough to serve the purpose of a desktop system, without causing too much hassle to the helloSystem developers, there's no big wins for this group either

aaaaand, finally, it's not really like space is an issue these days.

i do indeed like PkgBase for the space compactness and the speed of updates, however, for now i primarily use it to build jails

probonopd commented 3 years ago

Thanks for the explanation @igalic, makes sense to me.

grahamperrin commented 3 years ago

Home and End keys don't work in zsh. A surprise.

probonopd commented 3 years ago

Neither does the Delete key which I find most annoying. Do we need to apply some sane default configuration to zsh? Or just switch back to zcsh?

Oh well, Backspace is not working there for me either. Printing ~ instead. Same in xterm. Don't know why. In other applications the key woks just fine.

igalic commented 3 years ago

this sounds like an issue with the terminal (configuration)

probonopd commented 3 years ago

What exactly do you mean with "the terminal" @igalic? I tried both xterm and QTerminal. Same result.

igalic commented 3 years ago

most terminal emulators interpret backspace, home and end and delete, like the actual terminals from (ca) 63 years ago

that's why most terminal emulators have special keyboard configurations for emulating compatibility with something: vt100, xterm, Solaris, or any other thing in between

probonopd commented 3 years ago

So, "accumulated technical debt".

Neither does the Delete key which I find most annoying.

Need to test if this also happens when booting with boot_mute=NO.

grahamperrin commented 3 years ago

https://github.com/helloSystem/hello/issues/56#issuecomment-747710175

Currently, FreeBSD ships two shells, sh(1) and tcsh(1). …

For reference

I was mistaken in my belief that tcsh(1) is the default for new users.

Confirmed after booting from the FreeBSD-provided FreeBSD-12.2-RELEASE-amd64.vhd:

2021-01-17 14:16:01

https://www.freebsd.org/cgi/man.cgi?query=adduser(8)

igalic commented 3 years ago
  • bash is not an option for helloSystem due to it being from the GNU world

fish isn't much more suitable in that case

quoting from https://github.com/fish-shell/fish-shell/blob/master/COPYING

Most of fish is licensed under the GNU General Public License version 2, and you can redistribute it and/or modify it under the terms of the GNU GPL as published by the Free Software Foundation.

fish also includes software licensed under the GNU Lesser General Public License version 2, the OpenBSD license, the ISC license, and the NetBSD license.

Full licensing information is contained in doc_src/license.rst.

note that freebsd itself still contains some GPL code. for instance, until recently, the default grep was still GNU: https://cgit.freebsd.org/src/log/?qt=grep&q=gnu https://github.com/freebsd/freebsd-src/search?q=gnu&type=commits

probonopd commented 3 years ago

For now we have settled with zsh as the default shell in helloSystem; users are free to change it though.

If someone can make a strong case that we should switch to the FreeBSD default as described by @grahamperrin directly above, we may consider it for newly created user accounts.