top | item 33205970

Ask HN: Is it still possible to live in a terminal?

264 points| ilovecaching | 3 years ago | reply

In college I did a month long experiment where I only used my computer's terminal emulator to do all my work. I wrote my code/notes in Vim, browsed the web with elinks, and wrote my emails using mutt. It was a great learning experience.

Recently I looked into doing this again and ran into a bunch of issues:

- My company uses Slack's enterprise auth, and all the CLI slack clients I could find haven't been updated in years and no longer work.

- The web is using more javascript than in the past.

- Mutt doesn't handle multiple email accounts natively for work/personal. The solutions are hacks at best. Email servers are starting to use more complete auth mechanisms that don't work well with mutt.

It seems like the terminal world is slowly getting abandoned in favor of proprietary GUI apps. Anyone still living inside the terminal? Links to tools for Slack are appreciated.

253 comments

order
[+] reissbaker|3 years ago|reply
The Vim/Neovim ecosystem has gotten unbelievably better over the last 5-10 years. "Living in the terminal" for core development work is IMO better than pretty much anything else out there; my Neovim setup has a modern plugin manager; an IDE-like experience with fast autocompletion as I type, goto definition, and automated refactor support; and a side-drawer file browser navigable with Vim motions. It feels like an IDE, except that it launches in ~100ms and has ultra-low typing latency. Using it with tmux panes means I can have various drawers and panes with a series of full, incredibly fast terminals wherever I want, with long-running tasks like automated test watching/running while I edit code placed wherever I want around the editor panel. Not to mention the Cambrian explosion of "modern" terminal tooling getting built, like xplr [1], hyperfine [2], httpie [3], etc.

That being said, I think "living in the terminal" for general purpose computing, like browsing the web or talking to your coworkers, has been in a kind of frozen standstill while the rest of the world has moved on. I think it isn't worth trying to push non-dev work into the terminal currently.

1: https://github.com/sayanarijit/xplr

2: https://github.com/sharkdp/hyperfine

3: https://github.com/httpie/httpie

[+] mekster|3 years ago|reply
You sound like a sales pitch but my NeoVIM based off of AstroNvim breaks in very random ways across a dozen of servers even under same configuration, I'm about to try Helix instead of the ecosystem with pile of random quality plugins.

It looks promising at first with LSP and all that but I don't know when I had any stable moments.

[+] greymalik|3 years ago|reply
What setup/plugins do you recommend for using Neovim as an IDE replacement? I use vi for minor text editing but have never used it for development.
[+] gtsop|3 years ago|reply
coworker #1 was literally waiting 30seconsa for his webstorm to open a subdirectory (in a really big code tree)

coworker #2 was struggling with his vscode autodeleting some imports

strange times when you are the vim developer in the house and the one with the most solid IDE...

[+] yeswecatan|3 years ago|reply
Do you have your dotfiles on github?
[+] 29athrowaway|3 years ago|reply
Can you:

- Edit code

- Autocomplete

- Navigate code, find references, go to definitions

- Run your code

- Debug your code

- Test your code (including running a specific test)

- Profile your code

- Run multiple static analyzers simultaneously

- Use version control and annotate code using version control

- Do all that remotely or with containers involved

- Query a database and get results in a tabular format

- Spell checking

- Have collaborative editing

- Work with issue tracker tickets

- And more...

The sad reality is that for 99.9% of people using vim is reinventing the square wheel to produce a worse development experience and inferior code.

[+] pedrovhb|3 years ago|reply
I don't know about "living" in a terminal, but CLI/terminal tools are quite far from being out of the picture; if anything, I'd say they're thriving. It's not about one or the other; they're complementary, and I use both every day.

Personally, I use Firefox for browsing, PyCharm for coding, mpv/qimgv for media, and do pretty much everything else in the terminal. Terminal tools are incredibly versatile and composable in a way GUIs really can't match - for instance, I built a script that gets all the RAW files from my camera, converts them to jpg with darktable-cli, and optimizes them for filesize maintaining the same visual quality with jpeg-recompress, great for when I don't particularly care about editing each picture of a long hike. Next step will be to also push them to Google Drive, but I haven't gotten around to that yet. Similarly, the gopro-like camera I use for recording racing footage produces files with some weird filenames and terrible encoding which makes them enormous, so another script pulls the files, renames them to the date/time taken, and uses ffmpeg to transcode them to hevc, which saves several GB. Could I do this all from GUIs? Probably, but it'd involve a lot of hunting for files, dragging/dropping, and context switching between different programs. It's a lot more convenient to do it all in one short command.

There's also some amazing tools which just don't make much sense or would be quite contrived in GUI form. fd and fclones come to mind. AI is starting to be packaged as CLI tools, and it'll open up even more possibilities. Separate hiking pictures into their own directory? Sure! Find lecture videos mentioning a specific subject? No problem, this one doesn't mention the specific keyword you were looking for but it's also relevant at X timestamp!

[+] nissarup|3 years ago|reply
How is the results from the Darktable conversion? Are you able to share the script?
[+] zh3|3 years ago|reply
I keep a 'perfect terminal' in the office, basically a system with an nvidia 7600 in it because that's the fastest 2D text thing I've found to date (yes, modern cards are so slow in text mode it's not even funny). Configured for 24 VT's, a bunch of them autoconnect to remote systems/run specific applications etc at boot - so if I want the calculator, for example, it's Alt-F12.

For local graphics programs, that also provides a memory-mapped framebuffer which makes basic graphics a doddle. Beyond that, text-mode browsing has been too hard work for years (and so by extension email too). While it's very possible to 'cheat' by setting X to render to a framebuffer (either directly or in the background) the whole reason to use the text-only console is to focus on code without computer-borne interruptions.

Even on my graphical computer, it's basically terminals windows and a browser. Any piece of software that interrupts the flow is either configured to not do so, or discarded PDQ.

Terminals FTW.

[+] Melatonic|3 years ago|reply
What do you mean by fast or slow in text mode? Like the 7600 is literally writing text to the screen faster than modern cards or?
[+] cweagans|3 years ago|reply
> - My company uses Slack's enterprise auth, and all the CLI slack clients I could find haven't been updated in years and no longer work.

https://github.com/wee-slack/wee-slack is decent.

> - The web is using more javascript than in the past.

cli browsers are probably the only truly unrealistic thing. An idea that I've been kicking around for a while is to build a simple CLI "browser" that uses PhantomJS or similar under the hood to request, load, and render the page into an image, convert the image to sixel (https://en.wikipedia.org/wiki/Sixel) and display it that way (or use any of the various terminal emulator-specific features (KiTTY has https://sw.kovidgoyal.net/kitty/graphics-protocol/ for example)). Probably pretty clunky, but it's doable if you're in the mood to write something purely for fun.

> - Mutt doesn't handle multiple email accounts natively for work/personal. The solutions are hacks at best. Email servers are starting to use more complete auth mechanisms that don't work well with mutt.

I don't think they're hacks. You can define exactly how you want it to work. That's a feature, not a bug. Sure, it takes a little bit of work to set up but you can use https://github.com/cweagans/dotfiles/tree/master/.config/mut... as a starting point if you'd like.

[+] gregjor|3 years ago|reply
I do almost everything in terminal windows, but for emails, Slack, video calls, and other support-related things I use native MacOS/iPadOS apps. It doesn't make sense to do everything in a terminal because not every useful service works in a terminal. Choose your environment and tools based on utility.
[+] pram|3 years ago|reply
I agree. I don’t really understand the point in being a terminal maximalist. Yes, I do 90% of my work in vi or ssh and that’s what I prefer.

Checking my email or chatting though, why bother? The company pays for outlook and slack, I’d just be making my life pointlessly difficult.

[+] golly_ned|3 years ago|reply
Emacs (which can be run in the terminal using the "-nw" option) has a slack package -- I dipped my toes in and noped out quickly, as I found it too difficult and too ugly compared to using the app: https://github.com/yuya373/emacs-slack

I've tried to do the same thing: going completely text mode. For me, it was disastrous -- it was a big distraction for me at work, at two jobs. I even left a good job partially so that I could try to go text-mode rather than click my way through lots of GUIs. It was something of an obsession. Now I look back and sigh.

[+] oneplane|3 years ago|reply
It is possible but inadvisable. A more realistic approach would be terminal + browser.

Living in a terminal itself doesn't really mean much, as it strongly depends on your tasks. For things like number crunching or programming, it has a pretty big benefit (as text is the universal API after all), and you can do pretty much everything, usually faster and more reliable than a GUI can.

But when you need to do data visualisation, make use of external services that do not provide terminal emulation interfaces or want to work with people that do not live in a terminal, that makes a 60/40 split the best choice.

[+] blooalien|3 years ago|reply
Early on in my "Linux journey" Xorg and KDE both made some drastic (and not well planned) changes simultaneously that left me stranded in a terminal for several weeks. During that time I was surprised to learn how genuinely functional and capable the terminal could be. Turned out that nearly everything I needed to do was still possible with very few exceptions. Much of that still holds true today, with one major difference. The tools we have at the terminal these days are much nicer than they used to be. Some of them are quite close to GUI tools in their functionality and richness of display output. Because of this I still use the terminal quite heavily even while working primarily in a GUI environment, just because for many tasks it's quicker and easier by far than hunting through a GUI looking for the right place to click to get a thing done.
[+] habibur|3 years ago|reply
The solution is not to get religiously terminal.

I keep two desktops open and can flip with a keystroke.

One of those always runs a full screen browser on gnome desk, and the other is the shell.

I flip between those. Email is webmail but on the other screen code editor is vim.

[+] wollsmoth|3 years ago|reply
Yeah if you're more effective in terminal then go for it, but I think you'll at least need a good web browser to fill in the gaps.
[+] brudgers|3 years ago|reply
Since Emacs runs just fine in a terminal, I imagine so.

Although, if you are going to live in Emacs there might be enough terminal there without actually running it in a terminal.

[+] jolmg|3 years ago|reply
> - Mutt doesn't handle multiple email accounts natively for work/personal. The solutions are hacks at best.

I don't know about Mutt, but I've had no problems handling multiple accounts with mu4e on Emacs. `emacs`/`emacsclient` can be forced to use the terminal by using the `-nw` option.

isync/`mbsync` can also work with multiple accounts. Although, this program just sync's an IMAP account with a local Maildir that clients like mu4e can use for reading mail offline. It's an MRA[1] rather than a whole MUA.

There are many other terminal email clients you can also try.

> Email servers are starting to use more complete auth mechanisms that don't work well with mutt.

Google can support standard auth by activating 2FA, then making an app password. You can do this here:

https://myaccount.google.com/security

Google specifically needs "more complete auth mechanisms" because its regular password gives access to much more than an email account, since Google accounts are a huge platform. What other servers are moving away from standard auth mechanisms?

[1] https://en.wikipedia.org/wiki/Mail_retrieval_agent

[+] fishywang|3 years ago|reply
I'm not sure about mutt but I used neomutt with Google oauth just fine (the setup is not particularly easy per se, but not too bad either).
[+] mrweasel|3 years ago|reply
I was a terminal poweruser wannabe. For a time I tried just using tmux and Vim on almost all occasions. I still use Vim for something, like writing Puppet code. For everything else: I've just come to embrace to the GUI.

Unless you're an absolute terminal power user that can masterfully navigate tmux, vim or whatever tools you use, I don't think it's a good use of time. There certainly are things where the terminal is the right tools, use it in those situations. Just ask yourself if you're artificially limiting yourself, simply because you think the cool kids use the terminal.

[+] rgoulter|3 years ago|reply
I'd suggest zellij if tmux is too intimidating.

Rather. 99% of what I use tmux for is both: not what I would consider "power user" skills; what I think terminal emulators like kitty or iTerm2 will mimick anyway; and reflects how e.g. VSCode arranges its open files.

I find it convenient to have a session of tabs for a particular task/project, and to switch between the tabs depending on what I want to do.

That said, I rarely make use of split panes (nor a tiled window manager). YMMV, but I almost always want whatever I'm looking at to be fullscreen.

Zellij at least shows the keyboard shortcuts.

[+] notyourwork|3 years ago|reply
Many of our latest hires (new college grads) struggle with terminals and CLI in general. It seems like recently students have stopped getting this exposure which leads to them joining and not knowing how to ssh into a damn linux VM. It's a pretty daunting world.
[+] jll29|3 years ago|reply
It's upsetting to see how children's and young people's education gets dumbed down. I went to a toy shop earlier this week and the kits for scientific experiments (chemistry, electronics) have been dumbed down compared to the 1980s. Back then, you had a huge box with chemicals and tools and a proper 100+ page handbook full of experimental instructions (chemistry) or resistors, transistors capacitors etc, and a handbook full of design schemas that you may want to construct e.g. a little radios (electronics). Now you can do "20 safe experiments" like making a LED flash.

In computing, students want to do their coursework on their iPad in a notebook environment, relying mostly on step-by-step instructions given as PDF file or from an online tutorial, based on copy & paste, without understanding what they paste there instead of compiling libraries or write a makefiles from scratch.

Starting next summer, I will include a 2-3 hour UNIX command line (and also a 2-3 hour LaTeX) intro into all courses I teach where that can be justified. (The UNIX Power Tools [1] book is a useful resource for teaching, I found in the past.)

[1] https://www.amazon.de/Unix-Power-Tools-Classique-Us/dp/05960...

[+] heavyset_go|3 years ago|reply
I've talked with professors about this, and it seems that if students want to learn how to use the terminal, they need to figure it out themselves or take whatever UNIX/Linux-related classes that are offered, and those classes are usually electives and not required.

Apparently some professors are leaning more and more on desktop & cloud IDEs, and other development platforms that just let students code and not worry about the rest. The argument is that abstracting away system administration allows teachers to spend more time on the content they need to teach versus spending time setting up and debugging systems.

[+] jolmg|3 years ago|reply
> It seems like recently students have stopped getting this exposure

Depends on what you mean by recent. I wouldn't expect exposure to have been greater 10-15 years ago. If anything, I would expect CLI exposure to be greater now compared to then, at least because of the rise of git.

[+] geofft|3 years ago|reply
For Slack in particular, the deal is that new signins return a token that starts with "xoxc", not a token that starts with "xoxs", and that token requires corresponding cookies in order to be accepted. If you're grabbing a token out of the browser, you will also need to get cookies for slack.com and pass them in the client. Last I checked, you only strictly needed the cookie called "d", but you may as well grab all of them.

A bunch of folks who have been using Slack for a long time have saved their xoxs cookie from a couple of years ago and not invalidated their old sessions, and they'll tell you the various clients still work. For a new user who is getting an xoxc token, your client needs a way to pass cookies along with your token. Many of the terminal clients I've seen don't obviously give you a way to pass the cookie.

My company uses the enterprisiest Slack offering (Enterprise Grid, compliance archiving, proxy restrictions, the works) hooked up to Azure AD as the identity provider and previously to Okta via ADFS, and I have working programmatic auth to Slack (leveraging local Kerberos tickets from Windows AD signon). Give me some details on what your auth setup looks like and I can probably help you with it. (I can try to open-source my internal client if it helps, but it's specific in some ways to our setup so it might be easier to just talk you through it.)

[+] raydiatian|3 years ago|reply
I still find it utterly baffling that Windows and Apple haven’t integrated better “hyper-productivity” oriented workflows into their OSes. I’ve tried (and failed) on multiple occasions to “ditch the mouse” for full keyboard nav but it always comes up short around the browser. Even VS Code has pitiful keyboard-only navigation support.

These days I pretty much work exclusively in terminal, having gotten used to vim mappings and just sticking with it. Still, I’d rather be on a desktop.

[+] ar_lan|3 years ago|reply
Not natively, but through a handful of plugins I have been able to go most days on my MacBook without touching a mouse/trackpad.

There are occasional times I need to pull it out, however. But with Yabai + Vimium + terminal the majority of my day-to-day needs are met happily mouseless.

[+] zppln|3 years ago|reply
It obviously depends on your working environment..? I'd be screwed 5 minutes into my workday having to sign into our PDM.

> It seems like the terminal world is slowly getting abandoned in favor of proprietary GUI apps.

Eh, I'm seeing quite the opposite trend. I see people doing stuff that'd consider using a terminal to be straight up inappropriate for (e.g. displaying line graphs).

And your troubles with Slack is most likely down to it being proprietary garbage.

[+] howeyc|3 years ago|reply
For everything except web browsing, I use the terminal.

neovim - text editor

aerc - email

nzbget - usenet

irssi - chat

mpv - audio

still hoping for gemini to take over for a full terminal experience.

[+] wfleming|3 years ago|reply
I'm not sure what specific issues you've had with mutt, but I have mine setup with multiple accounts & have in the past used it for a work account where I had to do IMAP/SMTP auth via oauth token rather than username/password. It's definitely not a super well supported happy path & requires some setup, but it's worked well for me.

- Multiple accounts: I have a per-account config file with the relevant specifics (https://github.com/wfleming/dotfiles/tree/arch-linux/home/co...) and use folder hooks to apply those depending on which mailbox I'm viewing (https://github.com/wfleming/dotfiles/blob/arch-linux/home/co...). (Plus a keybinding in each account file to make flipping to the next account easy.)

- Non-standard auth:

  - I use offlineimap to sync my mail, and it supports oauth2 for Gmail. The arch wiki has helpful details: https://wiki.archlinux.org/title/OfflineIMAP#Configuring_OAuth2_and_getting_access_tokens_via_mailctl

  - For sending mail, I use msmtp, which also supports oauth2. Again, arch wiki has some helpful details. https://wiki.archlinux.org/title/Msmtp#OAuth2_Setup
For web & Slack, I sympathize and have toyed with CLI alternatives in the past, but I'm come to terms with the the fact that it's just not that feasible for the most part. Personally, I spend as much time in the terminal as I can, but I've given up on fighting against the tide for everything. The only native apps I usually have open are Firefox, Slack, and Spotify, and that's acceptable to me since it ends up meaning I still spend most of my day in a terminal.