12 ms·
I want a better shell (2019)
- MrWiffles 5y agoDoesn’t have all the author’s desired features out of the box, but recently I was forced into using PowerShell (Core edition, which is OSS, different from Windows only pwsh) for a work project and you know what? It’s surprisingly capable! It’s available from powershell/powershell on GitHub as a built binary for multiple systems and architectures including MacOS and Linux, or you could compile it yourself since it’s open source. The powershell gallery is the marketplace this guy was talking about, so there’s that. And you can distribute or consume fully encapsulated modules as well. The scripting language itself is fully object oriented, and while it takes some getting used to, you quickly start seeing real value in your day to day from the conventions and patterns established by the community over the years. I haven’t switched entirely from zsh yet, but I’m slowly investigating exactly how to do that as time allows. It’s a bit more verbose than typical Unix shells so you type a little more, but that’s a small price to pay for everything it brings to the table. If you’ve never tried it (OSS version, aka “core” edition) I highly recommend it. WAY easier to learn for first timers than bash!
- pjmlp 5y agoIt is builds up on top of Xerox PARC ideas regarding REPL and OS integration. UNIX systems could offer similar integration, via IPC mechanisms, KParts and DBus like communication, exposing shared libraries directly into the shell and structured data. Where it fails down is lack of standardization across the landscape, so that everything actually works together.
- thibran 5y agoDid you try out Nushell, what do you think about it in comparison to PowerShell?
- pxc 5y agoFish has taught me that I should strongly prefer shells with batteries included when it comes to interactivity, and Elvish has beautifully demonstrated how that can be taken even further with things like its built-in navigation mode. PowerShell's big weakness, imo, is that it lacks that emphasis on interactivity OOTB, and configuring it back in often results in astonishingly bad performance. That said, the language is way better than any traditional Unix shell, and the ecosystem of libraries and scripts is insanely comprehensive. Together, these factors make for an absolutely top-notch scripting experience. This is definitely one of the the biggest sources of inspiration for most next-gen Unix shells afaict.
- partdavid 5y agoI've found that as you learn, the verbosity kind of fades away, because you adapt your aliases and patterns to your work habits. The small amount of remaining "extra" verbosity that remains is very worth it, because it gives you more discoverability and more consistent ways of handling data in exchange. I would probably rephrase your statement about object-orientation: I don't think Powershell is particularly object-oriented, but it integrates nicely with object-oriented .NET. What I mean is: when writing extensions to Powershell in Powershell, you may use objects incidentally as containers for structured data, or occasionally to access details in .NET, but you are not creating objects or classes--you're working with functions in a straightforward way, and it's easy to make your functions behave like (take the same options in the same way as) "standard" commands. I switched (completely) a couple of years ago. The main "use case" that is Powershell's sweet spot for me is handling structured data. A lot of my operations have steps like: Do some data-wrangling to calculate a URL and request options for some data repository or integrated system API; Perform a network call or look something up in a big file of structured data; Munge and wrangle that data to extract information or calculate summaries; Perform more network calls based on that data and do further munging and calculating. This is usually discovery-oriented, interactive, ad-hoc lightweight integration, and it's in an environment where I'm doing something with this data (like figuring out a machine list from a couple of CMDBs, cross-referencing that with data from the monitoring system and maybe some lookups for system roles, and then performing commands on them). It's not a great fit for a "real" scripting language because the stuff about processing the data and doing the network calls is intermixed with lots of stuff that the "real" scripting language is not very good at, like interactively discovering what's in the data, invoking a bunch of OS commands and putting things together left-to-right in a pipeline you craft gradually. As your activity matures (you find yourself doing the same thing over and over), you can start factoring your code into reusable units, but not all of it, and Powershell is just super excellent at tasks at this boundary, because it's just fine as a programming language in its own right (much more capable than bash, and with goodies that you reference, like having dependency management) while being at least as good an interactive shell as bash. As a "Unix guy", I favor a lot of Unix-isms so of course I customize my shell heavily. I can do more powerful things in my prompt much more easily than with bash. I like the more familiar bash-style tab-completion than Powershell's, so I use the PSReadLine module settings to enable that. I use vi keys for command-line editing (with remapped cursor motion keys) and getting this done is easier to accomplish than doing so in bash. I don't like some of Powershell core's default aliases (like curl--I want curl to invoke the curl command, and I'll use iwr instead of curl when I want Invoke-WebRequest), so I disable them. I do all of my professional work on MacOS and Linux and Powershell is a good shell on both, and almost all of my experience with Powershell is as a Unix shell. I'm not much of a fan of commitment to the so-called "Unix philosophy", but I do think that Powershell reflects this philosophy better than a typical Unix shell and Unix commands. For example, once you learn how to sort the output of ls according to its standard options, all you've learned is something about the ls command. It doesn't help you in sorting a process list from ps. It also doesn't help you in sorting files by something other than size (-S), mtime (-t), atime (-u sort of), "natural version in the name (what?)" (-v), or alphabetically by extension (-X). According to the "Unix philosophy" what is the ls command even doing parsing and sorting version numbers anyway? In Powershell, it's more natural to let Sort-Object sort things, which it can do by any of the item's fields, not just what the ls author provided an option for; and once you know you can do that, you can do it for processes in just the same way, or AWS instances or anything else. Boom. Unix philosophy. (And if you just like using ls, and piping it to sort, that works fine, too, so no custom is imposed on you). It's kind of beautiful. Our views on what we want out of a shell are always based on the tasks we personally try to accomplish with it, and I don't think the author wants a "better shell" at all, but a better, more scriptable IDE. His "use cases" for the shell are all elementary file management and command invocation and he doesn't really seem clear on which component of his system the shell actually even is. Interestingly, there is a full TUI framework for Powershell and it's pretty cute! I didn't know about it before looking it up after reading this article.
- Jenk 5y agoI still find it grating with how pipes are handled. E.g. git ls-files --exclude-standard -o | For-Each { Remove-Item $_ } Just.. _why_ do I need that For-Each?! (Deliberately not using aliases for clarity)
- tyingq 5y agoAs far as I can tell, you don't need it if you're piping the right stuff to Remove-Item C:\temp\foo> dir Directory: C:\temp\foo Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 9/10/2021 1:03 PM 0 thing1 -a---- 9/10/2021 1:03 PM 0 thing2 -a---- 9/10/2021 1:03 PM 0 thing3 C:\temp\foo> dir thing* | Remove-Item C:\temp\foo> dir C:\temp\foo>
- Jenk 5y agodir works because it's actually an alias of Get-ChildItem, which returns a list of objects (DirectoryInfo or FileInfo). My example was specifically a list of paths that are not objects but just strings.
- tyingq 5y agoOkay. How about "echo"? (Aliased to Write-Output, which I assume is strings) C:\temp> dir file3 Directory: C:\temp Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 9/10/2021 1:03 PM 0 file3 C:\temp> echo "file3" | Remove-Item C:\temp> dir file3 dir : Cannot find path 'C:\temp\file3' because it does not exist. Edit: I see it now. It works with one string, but if I Write-Output "file1`r`nfile2" | Remove-Item it no longer works because it takes the whole string as an object. I'd have to pipe an array of strings rather than cr-lf separated strings. This does work: C:\temp> $foo="file1`r`nfile2" C:\temp> $foo -split '\r?\n' | Remove-Item
- Jenk 5y ago
- yoyohello13 5y agoI've recently been thrust into using PowerShell at work too, and it's fine. I still wouldn't choose it, given the option. I get why people like the object orient nature of it, but I also don't think I get much value from it. 9 times out of 10, if I need a shell script, it's just stringing commands together. If I'm doing something complex enough to really benefit from "everything is and object" then why not just use a more capable language like python? There is a trend of people making increasingly complex and expressive shell languages, but I don't really understand what problem they are trying to solve. Maybe what we really need is a less complex shell so people are less tempted to write complex logic with it.
- simion314 5y agoI did not use powersehll but recently I was using a CLI program that was outputting in a tabular format but it was not something well defined that I could easily (with my very limited shell experience) parse. Maybe it was the program fault that it did not offer some CSV output format or maybe there is a natural way of handeling it but is hard to google for it.
- rootsofallevil 5y ago> If I'm doing something complex enough to really benefit from "everything is and object" then why not just use a more capable language like python? I've seen this line of reasoning mentioned a lot but never justified. A few reasons to stick with Powershell over Python: Team might not be familiar with Python (and the benefits of learning might be outweighed by the learning curve, shallow as it might be) Hard to judge what the cutover point is (namely at what point does a script benefit from being written in Python?) A lot (some?) of stuff out of the box in PS requires libraries in Python, which requires installation, which cannot happen during the script (I think at least, I've not done that much Python)
- kukx 5y agoOne thing about PowerShell that annoys me is the verbosity and the use of capital letters in commands. While it is fine for scripts that you write once it feels suboptimal for daily use in a terminal, where I prefer the least strokes possible. Also the slow startup makes me often choose an alternative shell in Windows (CMD,bash).
- JoBrad 5y agoCasing doesn’t matter for Powershell commands, but it certainly Improves readability. Aliases certainly help when typing commands, too. I haven’t had startup speed issues with Powershell Core, but when I do, it’s usually because of commands in my profile (which it tells you about).
- partdavid 5y agoYou don't have to type capitals, and you have aliases just as terse and understandable (?) as standard unix commands: gci, iwr, ri, etc. So you don't have to type them if you don't want to. The But if you forget, it's nice to have them. And for commands at the margin of your memory they're entirely discoverable (including the aliases). It's not necessarily obvious when you start, but it's actually super useful to be able to use and re-use all your skills for selecting and filtering data. Being able to 'get-alias | where definition -like *item' is a great way to discover the terse aliases for file operations, for example.
- kukx 5y agoI know that there are built in workarounds ie default aliases and the case can be omitted. But it creates another set of problems related to documentation and code samples/conventions. The objects passing is great, but it is not enough for me, except for writing scripts. I guess there are ways to make it work fine as an interactive shell, but that is probably an extra customization and in some administrative environments it may not be possible.
- pjmlp 5y agoPascal casing is traditional in PC programming world, since the MS-DOS days, Microsoft just went along with the culture of the platform.
- eatonphil 5y agoI want a better shell but only in that I want a Bash-like language (with builtin Linux userland programs like mv, cp, etc.) that works across macOS, Linux, and Windows. (I cannot reliably get Bash for Windows installed on every Windows device I own.) I want this for cross-platform build scripts. I build a desktop app for Windows, mac and Linux. I don't want a different set of scripts in a different language for each platform. And I don't want to write in Python or JavaScript or Ruby or Perl because they're all so much more verbose than Bash. But Bash on its own isn't enough either. I need the same Linux userland commands to work the same way on Windows. Powershell has mv and cp but they don't work the same way or have the same flags. I hacked together a version of this language in Python that operates line by line and massages the differences between things like mv and environment variables in Windows, macOS, Linux. https://github.com/multiprocessio/datastation/blob/master/scripts/build.py https://github.com/multiprocessio/datastation/blob/master/sc... Here's a sample script it can run: yarn setenv UI_ESBUILD_ARGS "--minify" yarn build-ui prepend "window.DS_CONFIG_VERSION='{arg0}';" build/ui.js yarn build-desktop prepend "global.DS_CONFIG_VERSION='{arg0}';" build/desktop.js yarn electron-packager --overwrite --out=releases --build-version={arg0} --app-version={arg0} . "DataStation Community Edition" zip -r releases/{os}-{arch}-{arg0}.zip "releases/DataStation Community Edition-{os}-{arch}" But this is a massive hack. So I'm starting work on a real language that supports a reasonable subset of Bash on Windows, macOS, and Linux and brings a reimplementation of the few key Linux userland commands (mv, cp, mkdir, rm plus new programs like append, prepend, replace, etc.) built into the interpreter. A sketch of this more real version implemented in Go is here: https://github.com/multiprocessio/crosh https://github.com/multiprocessio/crosh. It doesn't build at all yet but if you're interested you can follow along.
- shagmin 5y agoHave you tried installing WSL2 and using a shell through that? Granted if Bash won't run on a machine reliably, WSL2 may not do much better on the same machine.
- eatonphil 5y agoYeah exactly. I cannot reliably get either WSL(1/2) or Bash for Windows installed on every device I own. It worked seamlessly on half of them and I can't figure out anything about why the others don't work at all.
- oscargrouch 5y agoI think what i'm working with would definitely help in this endeavor. Will let this comment here also as a mark, so i can come back latter (2 months from now) and poke the author to see if it does what he was intending.. Of course it not the concrete shell, but the platform to build such a shell, and anything else (applications in general) really..
- spicybright 5y agoSemi related. It's about re-working how processes handle I/O, but has some neat terminal UI elements https://acko.net/blog/on-termkit/ https://acko.net/blog/on-termkit/
- AtlasBarfed 5y agoCan I get a parseable ls? Can I get explicit output-as-json flags for all reasonable commands like ps, lsblk, ls, find, grep, etc? Can I get a database of commands better than history that shows when they were run and error codes that resulted AND THE OUTPUT, and if it completed for multithreaded/background/etc. The history-as-database is ultra-important for doing cli multiprocessing/async. Fire off command, and then you can get the output from the database to pipe to another command. Can I get a reasonable metashell standard across all terminal apps for doing a lot of what .profile does but isn't tied to a specific file on a specific machine?
- AtlasBarfed 5y agoI'll expand this more. What I really want and have already partially built for some things is a very powerful metashell for delivering commands across multiple machines and composing them. As referenced above, a central database of command, exec status, output, and where executed would be central to this. THe ability to define sets of machines as clusters and running and returning commands from those in parallel is also essential The ability to pull, push, edit files remotely... The ability to store access methods to deliver and return the commands: be it ssh, teleport, (ugh) telnet, kubectl, docker run, aws ssm, etc. I've written about 20% of that for my current job managing various nosql database clusters. But it is very much ugly and something I'm very far from being happy with, even after about two rewrites
- nathanmcrae 5y agoYou may have already seen it but jc (https://kellyjonbrazil.github.io/jc/ https://kellyjonbrazil.github.io/jc/) helps with the first two: $ jc ls -l | jq [ { "filename": "bin", "flags": "drwxr-xr-x", "links": 1, "owner": "nathanmcrae", "group": "nathanmcrae", "size": 4096, "date": "Jun 28 15:15" }, { "filename": "pkg", "flags": "drwxr-xr-x", "links": 1, "owner": "nathanmcrae", "group": "nathanmcrae", "size": 4096, "date": "Jun 28 15:15" } ]
- enriquto 5y agoThis is horrifying! Why would anybody want that?
- spsesk117 5y agoSometimes it seems like I'm the only person that doesn't feel like they need "a better shell". This topic comes up a lot on HN. Maybe if a better shell came along I'd be surprised, not knowing what I was missing. Perhaps I'm just in the dark or not imaginative enough to conceive of what one would look like. With that said, whenever the discussion comes up, it seems to revolve around user specific workflow cases and "do what I want you to do, not what I tell you to do" design patterns, that would (from my perspective at least) feel hard to get right for everyone. As a result, we have lots of different shells now that make different trade offs and take different design approaches. That's great, right? I don't know -- I'm rambling I suppose, I just don't ever really feel like Bash (or fish/zsh/whatever) is holding me back or making my work more difficult than it needs to be. We can argue about the esotericisms of shell scripting and how it's silly to emulate old terminal escape sequences in virtual terminals, but I feel like it misses the point. I don't know, I'm certainly willing to change my mind here, it's just that for all of the problems I have day to day in sysadmin/programming job functions, the shell is the least of my worries most of the time.
- rgoulter 5y agoFish shell's joke tagline is "Finally, a command line shell for the 90s". I believe that the developer experience for all sorts of tooling has improved dramatically over the last 15 years or so, coinciding with GitHub's rise in popularity. e.g. the plugin ecosystem for Vim or Emacs have improved, let alone options like VSCode. Tools like Vagrant made it easier to work with VMs. Containerised workflows have similarly improved some cases. Languages like Go-lang or Rust seem pretty nice in some cases. etc. Shells are also the kind of thing that developers use. I don't believe bash is the best we can practically get. -- Though.. I have heard of other, fancier shells; (or cool ideas like https://ambrevar.xyz/lisp-repl-shell/ https://ambrevar.xyz/lisp-repl-shell/ or http://howardism.org/Technical/Emacs/literate-devops.html http://howardism.org/Technical/Emacs/literate-devops.html). These haven't caught on.
- bradknowles 5y agoI don’t even see the need for fish or zsh. Bash is fine for me, and I just don’t see the point. Sure, if you want to use something else, you should feel free to knock yourself out. I do kinda wish I could filter out all the articles about other shells, though. They seem like a bit of wasted space to me.
- cyberbanjo 5y agoMany things requested are available in emacs. > However, I personally don’t use this capability of shell a lot: 90% of commands I enter are simpler than some `cmd | rg pattern`. > (kbd "C-c") doesn’t work as it works in every other application. So rebind it? Even terminal emulators allow for rebinding of keybindings, and so does emacs. > I launch GUI version of Emacs: the terminal one changes some keybindings, which is confusing to me. For example, I have splits inside emacs, and inside my terminal as well, and I just get confused as to which shortcut I should use. IMHE the solution is to decide which tiling manager you wish to you use (my experience is informed by using i3 to tile and sometimes emacs). 99% times I use my i3 to tile, and emacs only splits in half (C-x 2 or C-x 3 depending on what I need and how wide the emacs window is) > Why can’t I type cargo test, Enter, exa -l, Enter and have this program to automatically create the split? What you are looking for is `cargo test &`, `fg`, `bg`, and (kbd "C-z"), no? The ability to suspend and bring to foreground or background enables this kind of 1. run tests 2. list files. My own experience suggest that how I create the split is dependent on some, potentially implicit, context. > Additionally, while magit awesome, I want an option to use such interface for all my utilities. Like, for tar? Firmly agree, and I believe this is what the transient[1] package is for. > extensible application container, a-la Emacs or Eclipse, but focused for a shell use-case Emacs /is/ focused for shell-use case, at least in my understanding and use of it. > A UI framework for text-based UIs, using magit as a model. ctrl+c, ctrl+v and friends should work as expected. cua-mode enables the "normal" copy and paste bindings. > A tilling frame management, again, like the one in Emacs (and golden-ratio should be default). What's wrong with `C-x 1`, `C-x 2`, `C-x 3`? > A prompt, which is always available, and smartly (without blocking, splitting screen if necessary) spawns new processlets. Isn't this what M-x is or would it taking up the bottom line disqualify it for "splitting". Regarding blocking, I do agree it's very annoying to have emacs become unresponsive. > An API to let processlets interact with text UI. I would assume that there is something lacking from emacs lisp api[2] for manipulating emacs, but it's not clear what they are from this authors perspective. > A plugin marketplace (versions, dependencies, lockfile, backwards compatibility). What is wrong with melpa, quelpa, emacs-wiki, et al? > It doesn’t define out-of-process plugin API (things like hyperlinking output). It sounds like that would require the out-of-process layer (shell) to be as expressive as the in process layer. For instance, emacs can link to files, and new custom link styles, but my terminal is loathe to support http(s)/(s)ftp, and I presume is not easily extensible (as emacs) to new protocols. > Its main focus is text editing. Everything already communicates in text, it's not clear there is a obvious alternative or what would suceed text editing for this use-case. > Its defaults are not really great (fish shell is a great project to learn from here). Perhaps, but the gnu emacs community seem to profess a "we-came-first" mentality for conflicts with emacs defaults and the 'wider computing experience'. > ctrl+c, ctrl+v do not work by default, M-x is not really remappable. cua-mode and false, I have m-x remaped to use helm. 1: https://github.com/magit/transient https://github.com/magit/transient 2: https://www.gnu.org/software/emacs/manual/html_mono/elisp.html https://www.gnu.org/software/emacs/manual/html_mono/elisp.ht...
- NoGravitas 5y agoThis person really just needs to lean into Emacs harder. The real strength of Emacs comes when you use it for everything, and so have a perfectly consistent, extensible, and discoverable user environment.
- satyanash 5y ago> This person really just needs to lean into Emacs harder. hehe, +1 leaning into it harder means understanding it better, the internals, why it works and why it does things the way it does. Now only if our phones were lisp machines.
- jrm4 5y agoThis may seem unrelated but I'm going with it; I did Emacs for a year or so and while I understood that you CAN go this way, I mean, "difficulty in getting there" matters. "Do everything in Emacs" is an exceedingly short hop from "Maybe just write your own operating system." It's possible to do "very extensible" and "easy to onboard" -- Obsidian.md is the "actually usable Org-mode" I've been looking for, YMMV.
- NoGravitas 5y agoI'm coming up on using Emacs for 30 years this spring, so that's kind of a different experience from using it for a year or so.
- thom 5y agoYeah, a shell is just interacting with a bunch of text, and once you've built up some familiarity with Emacs you can reuse everything you've learned (search, autocomplete, cut/paste, and once you have some elisp skills then basically anything). One of my annoyances with VSCode, which I do think will one day eat the world, is that it still seems the basic level of abstraction is too high. So there's a separate terminal window, which I always have to tell to go away, and which has its own key bindings. What I want is just a text buffer running my shell, that behaves like every other text buffer. Same with the database clients available for VSCode - stop building UIs, just give me text with a process running in the background. The editor is already all the UI I need.
- nixpulvis 5y agoA lot of this has to do with the integration between the Terminal and the Shell. A project that came up recently that seems to take on a few of the issues is https://blog.warp.dev/how-warp-works https://blog.warp.dev/how-warp-works. I've been meaning to write up a proper critique of this project at some point, but I keep getting side-tracked. I also want a replacement for `fish`, however it's a pretty tall order to implement what I have in mind, and I got a bit stuck trying to find the right abstractions for background job management in Rust (there's a lot going on). But I genuinely believe a multi-language shell with POSIX support will finally allow us to move forward in the terminal environment. UI/UX issues like ctrl-c, window management, and everything else can be implemented as derivations from POSIX, or additions. While somewhat tangential to the main thread of this post, I'll still leave my (incomplete) shell here for anyone who's interested. https://github.com/nixpulvis/oursh https://github.com/nixpulvis/oursh. The README has a decent description of features I want off the bat, and there's a bunch of design level issues in the tracker. I'll never accept the death of the Terminal environment.
- haolez 5y agoFound in Warp's landing page: "Private - All cloud features are opt-in. Data is encrypted at rest." Wait... was this even under question? Why would my terminal not be private? :/
- wffurr 5y agoBecause it has cloud features: "#6: Leverage the cloud. The basics of computing have changed since the advent of the CLI, and no change has been more profound than the rise of the internet. Once you start to think about it, there are a lot of leverage points: why is shell history limited by your local hard-drive? Why doesn’t your shell configuration follow you across machines? Why can’t you transfer a CLI session to the browser so you can keep working on the go? (Don't worry, though, Warp is local-first, and all cloud features will be opt-in. You can find out more in our privacy policy)." https://blog.warp.dev/how-we-design-warp-our-product-philosophy/ https://blog.warp.dev/how-we-design-warp-our-product-philoso...
- hnlmorg 5y agoShameless plug but this is exactly what I'm working with my shell https://github.com/lmorg/murex https://github.com/lmorg/murex It's designed to work with JSON, YAML, CSV, etc so you don't need to remember jq syntax for JSON, awk for CSV, something else for S-Expressions and so on and so forth. It's the same commands (like grep) that work with all formats and are aware of the format. It can work with tmux to give do stuff like if you hit `F1` it will open up a pane to the right with the man page of the command you're typing. So it's been built around taking UI lessons from IDEs. But above all else, it's a $SHELL so it works find with all your existing CLI core utils. Which is more than can be said for the likes of Powershell. There is a learning curve though because it's not POSIX syntax. I've tried to keep some POSIX-isms where they've made sense but redesigned things where POSIX was a little counter-intuitive (though that's a subjective opinion). I've been using it as my primary shell for about 4 years now.
- partdavid 5y agoThat looks like a neat project! Nice. > But above all else, it's a $SHELL so it works find with all your existing CLI core utils. Which is more than can be said for the likes of Powershell. Can you expand on what you mean by this? I've been using Powershell as my primary shell for 2-3 years and this statement surprises me. There's no "core util" I can invoke that behaves differently or surprisingly in Powershell so I probably don't understand what you mean.
- hnlmorg 5y agoMaybe I'm wrong on this point then but the few times I've tried to Powershell in the past I had issues piping commands together because some commands expected text while others expected a .NET object and it all felt terribly like working in Delphi again with the type system actively working against you (I'm exaggerating a little here, love Pascal, but hopefully you get my point). Don't get me wrong, I love strongly typed languages. But when you're using the CLI you want a language that is optimised for ease and working with CLI tools and Powershell functions wasn't easy. But as I said, I might have been doing something wrong. And if that's the case I'll make sure I don't repeat that comment in the future :)
- tallclair 5y agoSomething that prevents me from adopting a lot of superior modern tools is that I need to SSH into a lot of servers and other machines that don't have the tools installed. I don't want to maintain the muscle memory and knowledge of 2 separate workflows & toolchains for the same tasks on different machines. I'd like to see something that runs locally with my aliases, keyboard shortcuts, plugins, etc. and translates the commands to a remote backend, maybe similar to VS code's remote development.
- mixmastamyk 5y agoSomething like ansible can synchronize a dev environment on a large number of boxes.
- partdavid 5y agoTrue. And here is where what people think is a virtue of a standard Unix shell (zsh or bash, say) is actually not as good as it seems ("it's already everywhere"); because shells like this don't have dependency management, you have to do it all yourself. Either out of band (make sure curl and jq is installed, which awk is this? oh and all the other little things that are buried in my scripts and functions but are not declared in a standard way). Now I have a full-on configuration management problem that I will need to integrate--just to make your shell scripts, snippets and functions work) or by bizarre horkiness in your scripts (pure-bash json libs, anyone?). Interestingly, if all of your machines were to have Powershell core, you can actually do a lot of what you describe over SSH more elegantly with Powershell remoting.
- XorNot 5y agoThis is what killed my experiment with an alternative shell for me: I didn't a bunch of time SSH'd to other machines trying to do things, and anything useful I learned didn't translate - whereas a quality bash function can be piped into the environment. Now my primary interest is essentially whether through an SSH tunnel using minimal tools I can pull the remote resources back to my machine and use a real environment.
- BeetleB 5y agoRegarding Emacs and this: > It doesn’t define out-of-process plugin API (things like hyperlinking output). The author may want to check out the GNU Hyperbole package.[1] I'm not a user, but those who can get through the strange docs and UI absolutely swear by it. [1] https://www.gnu.org/software/hyperbole/ https://www.gnu.org/software/hyperbole/
- 0xCMP 5y agoI've felt for a long time that we need a better Shell, but I think the next evolution is combining the Terminal and Shell together. I've never thought that what was good about the command line was that a terminal and shell are different. That's just an accident of history. In fact, this feels like a huge area where it's inferior. I don't actually know anyone who uses plain TTYs for their Shell. If you use a shell today it's 99% running inside of [iTerm2,terminal.app,Gnome Shell,uxrvt,alacritty,etc] on top of a window system. It feels obvious to me that instead of trying to emulate a hardware terminal from the 70s we should be building what is good about that interface into a GUI which makes managing processes, their outputs, and crafting the commands easier. Intelligent IDE-type auto complete, powerful history, collapsing large program outputs, smooth scrolling of the session, Tmux-style session management, built-in file browsing and previewing, dynamic/reactive prompts and status indicators. Except for Warp this feels like something few, if anyone, ever really considered. I often wonder why.
- SkyMarshal 5y agoSounds like what notty was trying to do, though it seems unmaintained for 5yrs. https://github.com/withoutboats/notty/ https://github.com/withoutboats/notty/
- jolmg 5y ago> I've never thought that what was good about the command line was that a terminal and shell are different... I don't actually know anyone who uses plain TTYs for their Shell. If you use a shell today it's 99% running inside of [iTerm2,terminal.app,Gnome Shell,uxrvt,alacritty,etc] on top of a window system. Interactive shells can be used without opening a graphical terminal. Simple examples are calling :shell from vim, or S in the `ranger` file manager, or entering a docker container, or using ssh. Terminals can also be used without a shell. For example, I have keybindings for opening a terminal with a file manager, or with vim, or with vim with the clipboard contents and special vim keybindings to handle it, or with nothing on it (a process that sends a stop signal to itself). This last one is to get a new unused terminal window to which I can redirect stuff. For example, with `gdb -tty` I can interact with a program from one terminal, while having another terminal control it with gdb. They really are 2 separate types of programs that are useful on their own, and their separation allows for more flexible handling, like how separate programs can take control of the terminal at separate times, like how it happens with vim's :shell, etc.
- iKlsR 5y agoI'm sure this exists in some form somewhere but something I really want is a way to pull up my command history numbered with a shortcut and then punch that number to run the last command than mindlessly hitting the up arrow for several seconds (why do we do this?). If anyone knows anything that has this functionality please share, thanks.
- cyberbanjo 5y ago!10 Runs tenth last command
- iKlsR 5y agoYes and there is also Ctrl+R which kicks off a recursive search which is what I use most of the time but what about the complex 2 liner with pipes and dates 19 commands ago? :)
- deleted 5y ago[deleted]
- mechtaev 5y agofzf can partially solve this, as shown in this blog post: https://nickjanetakis.com/blog/fuzzy-search-your-bash-history-in-style-with-fzf https://nickjanetakis.com/blog/fuzzy-search-your-bash-histor...
- iKlsR 5y agoExactly what I'm looking for, they even prelude with what I typed above, thanks.
- hotsauceror 5y agoEDIT: Oh. Duh. Brain freeze. Well, I’ll leave this here anyway. Won’t this work: $ history | grep SOME_UNIQUE_PART_OF_YOUR_TWO_LINER And then $ !HISTORYID ? I do this almost daily and with my bash history set to 10000 lines I pretty much find everything.
- kps 5y ago> ctrl+c, ctrl+v and friends should work as expected. Right — I expect Ctrl+C to send SIGINT, and Ctrl+V to take the next character literally. I hate it when programs hijack them for something else.
- agambrahma 5y agoIf you squint just right, Sublime Text, or even BBEdit, can serve this purpose (i.e. keeping aside Emacs and tmux+neovim for a moment)
- ithkuil 5y ago> When my Rust program panics and prints that it failed in my_crate::foo::bar function, I want this to be a hyperlink to the source code of the function. I had some success with good old plan 9 plumber (via the plan9 from user space distribution for Linux/Mac). You can define you're rules for which text to match under which context and it can send data to other programs, which can be scripts that talk to your editor and translate the clicked text into the right file and location to open.
- buescher 5y agoEvery so often I yearn for something that would be like a fusion of 4DOS/4NT/Take Command (https://prog21.dadgum.com/74.html https://prog21.dadgum.com/74.html), a lisp "listener" (https://common-lisp.net/project/mcclim/excite.html https://common-lisp.net/project/mcclim/excite.html) and a nicely pre-customized unix shell and terminal. Ideally something that could be also set up on a windows box without spending a day installing unix-style tools. I'd settle for a nicely pre-customized unix shell and terminal - what are the cool kids using these days? fish?
- inshadows 5y agoBetter shell should support pointer devices/events. It's shame that you can't move cursor by mouse in Unix shell. There are some hacks in Zsh but I haven't yet found enough courage to explore it. This is one thing that Command Prompt and PowerShell in Windows can do. :)
- mlindner 5y agoI don't need a better shell, I need a better terminal. On Mac we have Terminal.app which is nice and fast but the feature set is limited and notably doesn't support full color. On the other hand we have iTerm 2 which has too many features (creeping featurism) and is completely ass slow and most annoyingly has high latency. It also leaks memory like it's going out of fashion. Running neovim on fish on iTerm 2 is just an utter pain.
- zz865 5y agoI find the current shell world obsolete. grep/pipes/sed/awk are byzantine. Most REPL environments are better. I'd like a terminal to go straight to Python REPL and run just Python commands. Would be much simpler.
- iandinwoodie 5y agoI did a quick search for a Python-based shell and found Xonsh [0]; thought you might find it interesting. 0. https://github.com/xonsh/xonsh https://github.com/xonsh/xonsh
- partdavid 5y agoWhat do you mean, "you'd like"? Why can't you do that now?
- zz865 5y agoIt doesnt work if you're the only one, it would have to be the most popular.
- pxc 5y ago> grep/pipes/sed/awk are byzantine Ok wait Awk and sed are entire programming languages, so like, ok... fair. It hardly seems fair to call grep byzantine to me, since although it is based around a DSL, it's an extremely common one that you'll find in every programming language, including Python. But fine, regexps aren't for everyone. But pipes?? What's the problem with pipes? Don't you ever compose functions in your code or call map() over your data structures? How are pipes any trickier than the kinds of control flow you might use in Python?
- Ericson2314 5y agoI just want to invert the shell and the terminal: a programming language that spawns piped text boxes or terminal emulator box for each command run. screen/tmux is also all wrong: the "rendering" should be entirely client side, with server-side running the commands with pipes and keeping some state and history from which to render scrollback, but that's it.
- samcal 5y agoWhat features do you gain by architecting tmux/screen that way? It seems like you'd lose a nice feature, the ability to persist sessions' appearance after the client exits
- Ericson2314 5y agoThe ability to render things client side in a way the server doesn't anticipate, e.g. native widgets on various platforms. I don't see myself loosing anything of value? If the data you are talking about is e.g scroll back, nothing is preventing me from storing a wee bit extra metadata on the server.
- stonewareslord 5y agoLike some other commenters here, I don't think I've found any repetitive tasks that aren't scriptable. Aliases and functions handle every one of my use cases and they probably would handle OPs as well. For example, he could install moeeutils and then just: alias pre-commit='chronic cargo test& exa -l; wait' If you really want splits, just spawn tmux with two panes using Tmuxinator, or: pre-commit() { tmux new-session \; \ send-keys 'cargo test || read' C-m \; \ split-window -v \; \ send-keys 'exa -l' C-m } Shell is powerful because of its compossibility, but if you don't choose to learn it then of course it feels clunky
- notriddle 5y agoNot knowing shell is hardly the reason I think it’s clunky, and probably not TFA’s reason. Just to list a few of my own grievances: * If you use tmux splitting, then mouse selection doesn’t always work right. * Data with embedded spaces is clunky. Data with embedded line breaks is almost unusable. It can be done, but it’s not the default. * A lot of work is done with little languages, like AWK, embedded in shell, requiring double-escaping.
- watersb 5y agoPowerShell is pretty good. But I still just use zsh and bash.
- deleted 5y ago[deleted]
- wly_cdgr 5y agoDoes anyone know what theme that is in their screenshot? It looks great
- ilyash 5y agoShameless plug follows. I think shells are horrible not only from (today's) programming perspective but also from UI/UX perspective. In response to commands, shells dump text to your screen: from stdout, from stderr, from different programs, humanly unreadable amounts - they just don't care, it's "not the shell's job" apparently. Here is my take: the shell's job is to do everything for my productivity. Imagine programmers arguing that "notepad" is the best, IDEs are not needed, we need to keep text editing pure. How about shells output objects on the screen and these can be interacted with? Amazing for shells, right? This exists for decades everywhere else. My vision for UI in NGS - https://github.com/ngs-lang/ngs/wiki/UI-Design https://github.com/ngs-lang/ngs/wiki/UI-Design