Evolution of shells in Linux (2011)
ibm.com
ibm.com
Think of a browser window with the url-bar being the shell line editor. But of course I want a real, quick shell, not a clunky electron-based monster or some html based shell simulation in a browser.
I imagine that it will have a positive effect on our neck muscles if we would not have to stare at the bottom of the screen all the time, but instead at the top.
I looked into the existing pythonic shell libraries like the python-prompt-toolkit but could not figure out in a few minutes how this could be realized, so I hope some experts in this field would like to spend a few minutes on this?
Thanks for your attention!
You could reset the title on each keystroke, or even just after inputting the full command.
Does your history becomes like this:
Second result - line 1
Second result - line 2
Command prompt
y
First result - line 1
First result - line 2
Or this: First result - line 1
First result - line 2
Command prompt
y
Second result - line 1
Second result - line 2
And if it is the second option, how does it at the instants it shows the prompt, and after it gets a result?Looks complex to me.
The responses of commands are "long rolls of digital paper". They could be from 1 to millions of lines long.
So what exactly would your solution do differently?
And it's not "unix" that does it this way, it's VMS, Windows, and pretty much everybody.
In fact your concept is still not concrete enough to make sense. The browser can have a single address bar on top, because urls are a single string -- and they also don't interact with subsequent contents, commands, etc.
[0] http://pastebin.com/xaLFyXtT - implementation
[1] http://www.termsys.demon.co.uk/vtansi.htm - reference for some ANSI control codes
ascii.io seems down, but there is another screencast hosted here: https://asciinema.org/a/3779
unautoclear Turn OFF clear-screen after each command.
seems difficult?I was hoping to find some good reasons why I should (or shouldn't) use it over bash.
Just ignore the "i dont know" questions. The defaults all work well.
The improvements of zsh over bash are all rather small. And a lot can be achieved by configuring bash heavily. But they all add up to give a nice producivity boost.
What I like (some of those come from oh-my-zsh rather then zsh):
* way better autocompletion
* directory stacks (love em)
* way better behaviour for rm / rm -r (confirm prompts, etc)
* small but nice: if output of a program lacks a \n at the end, it is inserted (with a visual marker)
* ".." or "..." for going up the directory tree, without "cd"
* from oh-my: great aliases for git (git add - ga, git
bash is trying to catch up in many areas but not quite there.
Having said that, I've now switched to fish which I don't like but it doesn't need configuring.
That's a plus, but I really don't like how unlike the standard shells fish is. That's not entirely a bad thing (c.f. eshell, which is an interesting experiment), but also not a good thing (c.f. eshell, which is AFAICT unusable).
Another issue I have with fish is its popularity. eshell isn't popular, and so eshellisms don't tend to creep into shared environments; fish is popular, and more and more fishisms are creeping into the world at large. This is not, I think, a good thing at all.
If you're putting shell examples out into the world, they should be POSIX-compatible, or at the very least an extension of POSIX; they shouldn't be some wonky other language (else why use shell at all; use a better language altogether, which fish isn't).
I'd really like to see a good reason to use fish over zsh or bash.
If you want to be constrained by POSIX (as we will all be for the next 100 years or so), there are literally myriads of shells you can use.
set foo "Hello World"
count $foo # gives 1So I feel it's justified to say that fish is a different language than POSIX shell.
However I don't like their new shell syntax, especially env vars handling. Doubt it's configurable.
So while you can't do "PATH=$PATH", you could easily make a function that parses that for you, and have "env PATH=$PATH". It's a limitation.
However, it does mean that instead of something like Bash's insanity around P1 when you want a contextual prompt, fish_prompt is a function, with all the beauty of ifs, fors, and whiles spread out in an easy to read language.
Fish can be hit or miss, but it feels like Lua for the shell, to me.
Interestingly, even cmd.exe on Windows (at least on Windows 7 and newer) supports pushd/popd.
alias cd=pushd
I don't have a taste for pulldown terminals.
As per the pulldown terminals, do you mean the dropdown menus? If so this can be avoided by using the readline shell instead of the prompt-toolkit one.
% for i in dash mksh zsh bash xonsh; do; /usr/bin/time $i -c /usr/bin/ls; done
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 1884maxresident)k
0inputs+0outputs (0major+127minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 1820maxresident)k
0inputs+0outputs (0major+136minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 50%CPU (0avgtext+0avgdata 3204maxresident)k
0inputs+0outputs (0major+251minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 60%CPU (0avgtext+0avgdata 3092maxresident)k
0inputs+0outputs (0major+244minor)pagefaults 0swaps
0.41user 0.06system 0:00.48elapsed 100%CPU (0avgtext+0avgdata 58768maxresident)k
0inputs+24outputs (0major+22347minor)pagefaults 0swaps
Do you think the difference is large enough to warrant a bug report?I don't mean dropdown menus; "pulldown" was my misnomer. I meant dropdown terminal emulators like Guake, Terminator, Yakuake, etc. They are meant to be running in the background, and swoop down on pressing a hot key, inspired by "~" opening a console in Quake games.