
Tab completion in OpenBSD's ksh - brynet
https://deftly.net/posts/2017-05-01-openbsd-ksh-tab-complete.html
======
stock_toaster
Is there much benefit from pledging a shell?

I thought a fork/exec (seems like a core requirement for a shell) didn't
inherit the pledge from the parent?

    
    
      > promise: exec
      > Allows a process to call execve(2). Coupled with the proc promise,
      > this allows a process to fork and execute another program. The new
      > program starts running without pledge active and hopefully makes
      > a new pledge()
      > -- openbsd pledge(2) manpage

~~~
brynet
Of course, it's a shell. Shells need to execute other programs, but the shell
itself doesn't need to open sockets, or use random ioctl calls, or other
privileged things.

~~~
wink
Hey, sockets in bash are a feature ;)

------
eridius
Where did the author get the idea that fish is 200k SLOC? They're wildly mis-
counting.

Yes, `cloc` on a fresh checkout of fish-shell says there's 200k lines, but
most of that isn't fish-shell source. Fully half of that is from PCRE. And if
I run `cloc` on just the `src` directory I get 39k lines.

~~~
majewsky
No matter how many of these lines you label as "fish" and "not-fish", they
somehow all end up in "/usr/bin/fish".

~~~
i80and
Well, not necessarily. The linker will strip out any symbols that aren't
actually used, which may indeed be a non-inconsequential chunk of fish's
bundled dependencies.

------
dennykane
A brand new kind of [nearly] POSIX compliant shell can be found here, in a
little project called "Linux on the Web" (requires Chrome):
[https://linuxontheweb.appspot.com](https://linuxontheweb.appspot.com)

The main JS file that implements it is currently showing less than 6k lines
(which doesn't include the lexer/tokenizer, in another file, and adds another
couple thousand).

I have seen silly toys in websites that have superficial resemblances to *nix
shells, but this one seriously borders on 100% standards compliance. Most
users will want to run this command upon system "bootup":

$ import fs

... which loads in a lot of typical filesystem related commands like cp, mv,
rm, and less. The command to edit files is:

$ edit file_name.txt

... which you can throw a '-c' flag in order to create a new, empty file at
the same time. Alt+s to save edits, Ctrl+x to exit. Several nano key bindings
apply.

You can do something like this to see the gui in action:

$ import gui && desk

Then you are on the desktop. You can do an Alt+t to open the terminal while
there. This is a decent video to start out with:
[https://www.youtube.com/watch?v=9tl8I8YcH7g](https://www.youtube.com/watch?v=9tl8I8YcH7g)

A couple other recent videos can then be found from there.

