reddit / emacs

GUI vs Terminal Emacs workflow. Advice from programmers & server admins?

amasunbey · 2022-12-02 22:26
After experiencing how unholistic it feels configuring and extending VS Code, I started doing my research. I've tried Vim and Neovim more which has a fractured community. I question Vim's perceived efficiency with its keybindings and modal workflow but know it is universally available and quick to load. Testing Emacs for the first time opened my eyes and challenged what I thought I ever knew about it. The wealth of its built-in package manager with repos and extensibility is incredible. I thought it was all terminal focused but found out about the GUI and that a large majority of the community is using it. Now I am comfortable in the terminal but far from elite and have never tried a full terminal workflow. I'd like to hear from professional programmers and admins. What is your preferred choice? I want to know and grok the possibilities of using an editor inside a terminal, do you have more functionality, are you able to pipe things easier, etc. I know the benefits of the GUI in graphics and keybindings but is there feature loss or pain points when using something like vterm. Emacs is very flexible and there is many, many ways to complete work. In your opinion, should a person that wants to be the best programmer and admin possible focus on using GUI or Terminal Emacs? Thanks a million.
Alan_Shutko · 2022-12-02 22:35
Honestly, ever since I got an X server in the 90s I haven't wanted to use the terminal version of Emacs. If I were remoting into a system and needed to run Emacs there for some reason I would use it in a terminal, but otherwise just no. Graphical emacs offers many more possibilities for display and in my opinion just looks better. And not everything needs to be the same font.
amasunbey · 2022-12-02 22:44
Thanks for the great insight. You have been using Emacs as long as I’ve been alive. Vim culture seems to have made doing everything from a terminal seem common. I just want to make sure I’m not missing out on something.
bobbycancode · 2022-12-02 23:27
Agreed. If you need to use emacs on a remote machine, I suggest using x2Go versus vanilla `ssh -X;` you'll get better performance and persistent sessions.
scherbi · 2022-12-02 23:34
I used terminal emacs for many years, inside tmux. It was very nice being able to disconnect from tmux on Friday, and reconnect on Monday and be right where I left off. I was never able to get tramp working on my windows laptop, so learned the heck out of that setup. It was great Work got me a MacBook a few months ago, and tramp works well from there, so I don't use terminal emacs so much anymore. I'm glad it is still there for me when I need it though.
HM0880 · 2022-12-02 23:43
GUI > terminal More specifically, the GUI allows everything from the terminal + more (e.g., displaying pictures and PDFs). Have you looked into TRAMP and Vterm?
captain_only · 2022-12-02 23:50
Terminal all the way. I have an emacs server running on a VM I can reach from all my client PCs. I use mintty and mosh so I can walk away from my PC at the office and pick up right where I left off at home, or anywhere my laptop goes.
MitchellMarquez42 · 2022-12-03 00:09
(obligatory not a professional, but do program and admin for fun) The thing about Emacs is that you don't really have to leave it to do things in the terminal. You can set up a hook to recompile code on save, or commands to pull information from a shell command, etc. There's wrappers such as `M-x find-grep` that sets up a complex command, lets you customize it, and puts the results in a clickable list. The only real difference between terminal and gui Emacs is that the gui can display images and proportional fonts. Emacs has been a TUI since the beginning of time, and the gui itself functions a lot like a terminal.
tdrhq · 2022-12-03 00:32
When I'm at my desktop, I use the GUI. But about 50% of the time I spend on the couch with my laptop, ssh-ing into my desktop. And that's always on the terminal using emacsclient. If you're new to Emacs, I do suggest spending a few weeks using Emacs from a terminal. It forces you to build the muscle memory to navigate with the keyboard. After a while you really won't notice the difference between both, and you'll use both pretty much identically.
johnm · 2022-12-03 00:51
GUI + emacsclient. :-) But depending on how much you work with a variety of other systems, have a clean/fast/simpler .emacs setup for running emacs from a terminal can be a help.
dpoggio · 2022-12-03 01:41
Programmer here, 80% of my day is GUI Emacs. Why? Fonts + inline images in org-mode.
blah1998z · 2022-12-03 02:08
Either can work just fine (I use terminal at home and GUI at work so i can theme it really nicely and there's the off-chance a co-worker might consider giving Emacs a try). You'll likely want GUI as it can do things that the trrminal simply can't (like proportional fonts and various font sizes and images (which enables you to do things like read PDFs from Emacs)
cosmofur · 2022-12-03 02:18
Terminal only for me. I admin about 8500 servers, most connected by convulated and locked down vpns and many "you can't get here from there" networks. I can't even ssh to most of them directly from any workstation, but only though an mfa gatekeeper citrx version of putty. Many I'm not allowed, do to security rules, to even use mouse based cut and paste. piping X through ssh is not allowed, and even when I can get to some sort of console, we do not install the neccessary Xlib for any sort of GUI to work. But I was able to get emacs approved to be installed. With that I have a "windows" milti buffering usefull work environment that keeps me from going insane. I've been doing this since 1984. With 100,000s of lines if code in hard C and original (well post sys V) sh under my belt. So whenever I see a wet faced newbe tell me they need a graphical interface, 64G memory and 3 monitors and the equivilent of thier own personal T3 internet connection, to write "hello world" ... I pat them on their head, give them a lollipop, and send out to play.
amasunbey · 2022-12-03 02:33
Lol. That's awesome. Good to hear from someone with so much experience. If your work environment didn't have those restraints and you could use the GUI, would you? Are there any workflow features from using terminal Emacs that you would miss?
redguardtoo · 2022-12-03 02:42
I've been using Emacs in terminal since the beginning. For me, user experience is same because I don't use Emacs to view images. I use `shell-mode` a lot. It's doing ok for my workflow. don't know much about vterm but it must be better than `shell-mode`. my setup, https://github.com/redguardtoo/emacs.d BTW, I'm also good at vscode and vim and can switch to them any time because I use "vim's keybindings and modal workflow" which are available in all the editors.
BunnyLushington · 2022-12-03 05:46
>So whenever I see a wet faced newbe tell me they need a graphical interface \[...\] I wholeheartedly agree with your last paragraph (I started on a vt100 in my dorm room); however, depending on the language, the GUI bling can be nice if LSP is involved. I've learned that there are languages that really do benefit from the integration. I'm thinking specifically of Go. Hitherto my primary languages have been Erlang and CL, for which LSP was a nice-to-have novelty. Go is so B&D that the LSP -- along with the GUI frills -- is actually pretty useful. (Heck, if you can't have actual macros I suppose Emacs filling in all the blanks is the next best thing.)
BunnyLushington · 2022-12-03 05:49
>don't know much about vterm but it must be better than > >shell-mode. It's really worth the (minimal) effort. I made the switch about about a year ago and haven't touched shell-mode since.
BunnyLushington · 2022-12-03 06:21
Great question and nicely asked. To be honest, I don't think it matters too much. Whenever I can -- most of the time -- I opt for the GUI. If you're just starting your Emacs journey, I think there's a lot to be said for having easy access to the menubar: it's a significant help when discovering new functionality. I honestly don't think there's any benefit, functionally, in sticking to a terminal. The powers that be gave us fancy screens, we may as well take advantage. Unlike many (and I'm not trying to start a war here) I stick largely to the default keybindings and bind useful functions to hyper and super as I go. When I end up admin'ing a box without my .emacs loaded things continue to work as I'd expect. I'll add that I wouldn't judge anyone for using the GUI (or even the mouse!). Although I've been known to lament the fact, it's not 1989 anymore. I can only imagine the me using XEmacs on an RS6k would have a slack jaw looking at how great the Emacs UI is now. One bit of unsolicited advice: if you're doing administration, know enough vi to be at least minimally productive. I wouldn't want to code in it but it's a must have if Emacs isn't readily available. Okay, two pieces ... if you end up using the GUI, try remapping your caps lock to control.
algalgal · 2022-12-03 06:30
Both are great. I use the GUI most of the day on my laptop and the tty mode when working on servers. I prefer this to VNC or X because ssh is much easier to setup and works better on bad connections and limited client devices. I version control and share my .emacs.d so I get nearly the same visual appearance and keybinds and other configurations everywhere. My main tip for getting the most out of the terminal is to spend the time on a few things upfront. First, choose a terminal client that supports 24 bit color and ensure you have a portable, simple way to setup any server with that. This gets the visuals right, as long as you’re not rendering a lot of online equations, images, or pdfs. Second, configure your client so all the key modifiers you use pass thru properly. This is tricky and I’ve only ever gotten about 95% of the way there. This is the biggest downside in my experience. Last, of course, get familiar with tmux and possibly also mosh if you ever want to work from mobile devices or spotty connections, like on a bus.
flagos · 2022-12-03 06:46
Terminal Emacs user here. I'm using it inside tmux. I don't really like the way the shells are managed inside emacs, I prefer to use a native one. Another benefo: I can also work on my laptop, and also ssh from my desktop to my.company's laptop and find my environment as it was 2 seconds before. I like the minimalism of this setup, it's completely keyboard driven. I set the terminal to be full-screen, and as tmux can have several windows, can split them, etc.. basically it's like having a tiling window manager and emacs living in one of it's window. After all these years, everything is working pretty well in emacs terminal mode. I don't have even examples of things that do not work properly except obvious stuff like "you cannot read pdf in terminal mode".
PetrzalkaRulez · 2022-12-03 07:15
Like others already shared, both TUI and GUI versions work in the same way and it really should not matter, which one you end up running (besides GUI version having some niceties \*on top\*). There is one big BUT. And that is keyboard handling with terminals. You can't easily type some of the commands like C-M-% and need to revert to M-x query-replace-regexp. Moreover if your keyboard layout is not us - or rather let's say if your keyboard layout has to type numbers with shift, then typing numeric arguments like C-5 will not be possible in TUI. Yes, longer version via C-u 5 works, but it slows down your tempo.
Soupeeee · 2022-12-03 07:27
Programmer here. I don't actually do system administration all that much, and I usually just use vim for the quick checks and edits I need to do when I'm working on a remote server. I use both terminal and GUI Emacs, but stick to the GUI unless it's not available for some reason, which actually happens more often then you'd think. For all practical purposes, the two have exactly the same functionality except for things like images or embedded widgets, which I really don't use all that often. The mouse is nice to have, but I quickly fall back to muscle memory for scrolling and everything else anyways.
[deleted] · 2022-12-03 09:38
[removed]
Dietr1ch · 2022-12-03 09:57
TRAMP is game-changing
Dietr1ch · 2022-12-03 10:03
It seems to me that you might just want to use tramp's multi-hop support and have a couple of org-file to use as an index. * MachineA [[/ssh:me@a:Docs/a.txt]] ** Machine AA [[/ssh:me@a|ssh:myself@aa:/tmp/aa.txt]] * MachineB [[/ssh:me@b:.config/systemd/user/emacs.service]]
r0flcopt3r · 2022-12-03 10:48
Working like that sounds like literal hell. And I refuse to believe it's any more secure to do it like this.
r0flcopt3r · 2022-12-03 10:57
Have you tried vterm? Vterm is only a problem if I accidentally open an edtior inside it. But this can be solved using emacsclient as your EDITOR, or if you setup integration between vterm and your shell. With also if you're using the Emacs daemon I can't imagine a case that tmux handles that Emacs does not. For SSH, just use tramp-mode, unless you require LSP stuff, it doesn't always play nice with that. Arguably this is more minimal, as you've now removed three entire programs from your stack.
doolio_ · 2022-12-03 10:58
Isn't the menu bar available in the TUI?
Horrih · 2022-12-03 12:23
Well I have used both. And both have their strengths : Gui can embed images, have variable fonts, have a prettier UI generally. If you do a lot of org-mode, latex, or want an avdanced UI to turn your emacs into a graphical IDE this is the way to go. I personnally use tmux + terminal emacs. This has several advantages - no gui means that you can do that to connect to any kind of server, or VM, without dropped frames, or tramp mode - you can restore Everything the way you left it, be it on premise or through ssh, it does not matter - you make your sessions independent of emacs :if emacs crashes Everything else still works fine. - you can have multiple tabs per tmux session, and have multiple sessions that can be left/joined at any point. You could probably have something like this with emacs, I have tried several time to achieve the same in pure emacs but it never felt as confortable. - you don't need to compile special plugins like vterm for efficient terminal operations - honestly the terminal UI works really well : since i only use the keyboard the lack of buttons is not an issue In the end, everytime there is a VM or ssh-ing to server involved, I prefer tmux + TUI to the GUI version. I do a lot of development on a slow VM and that helps a lot.
Linuxllc · 2022-12-03 13:37
Workflow; to me is being comfortable and seems I'm moving at a decent pace. Don't matter what you use or how you're using it. As long the workflow is working out for you. You always can test yourself. Using something different or in a different way. Getting out of your comfort zone. Just to see if you can improve your workflow a little bit. Mostly new tools or even a new improve upgrade of what I'm currently using. Sometime can improve my workflow a tad better.
lykwydchykyn · 2022-12-03 13:38
If you want to be the best programmer or administrator possible, you have much more important things to worry about. Other than a few features and keybindings not working in the terminal, its pretty much the same.
ottersinabox · 2022-12-03 13:58
Programmer here. Professionally for 15 years. The most recent five years being at a robotics company I started. GUI emacs for all 15 years. I use GUI emacs for a few reasons. I like being able to see pdfs directly in Emacs. I like how I can drag and drop files from my file manager directly into dired. I like doing this kind of thing: https://www.reddit.com/r/emacs/comments/jj269n/display_helm_frames_in_the_center_of_emacs/ I have helm run as a separate pop up that's always in the same place and doesn't impact the formatting of my windows. I like being able to bind all the keys without worrying about what conflicts with the terminal emulator. Being able to open new frames makes multi monitor really easy. Sometimes I even use the built in WebKit support. I run all my terminal instances in Emacs in vterm. Makes it easy to name the terminal instances (since they're just buffers) so I can easily switch between them and my code and whatever else I'm doing without much of a context switch. I understand that people have different workflows and what works well for them. But for me, it's hard to imagine moving away from that.
[deleted] · 2022-12-03 14:13
[deleted]
mm007emko · 2022-12-03 18:47
I use both. GUI when I can. Text when I can't. Sometimes 'ss -X' is not an option.
mgeisler · 2022-12-03 22:12
I do the same: I work on the Android platform and it takes a while to compile that... So I need to use a beefy workstation for that. When I'm not in the office, I connect to it via SSH and reattach to my `emacs --daemon` session. That works great: all my files are open and if the connection drops, I can quickly reconnect and rejoin the session.
cosmofur · 2022-12-04 02:34
I actually agree that its more about security theater than really more secure. But the security department is both larger and better funded than us 'measly' Infrastructure folk. Result is that unless there is a failure that causes measurable $ loss that can be tracked back to a badly thought-out security rule, it is really hard to win arguments with them. My groups 'time' is not measured or budgeted in a way that makes our overtime efforts seen as costly to the company. So our quality of life connivence is just not worth arguing about. (The company is medium large, around 35,000 people, and our department which is Infrastructure and Cloud computing, support come in around 16) We get about two rows of cubicles, where information security gets a whole building to themselves.
plm314 · 2022-12-04 03:00
Both modes are useful and good to know. I typically start an emacs daemon on any remote machine with lots of state (many running jobs, cluster monitoring tools, interactive analyses sessions) and keep the option to connect in terminal mode or graphical mode later. On my interactive machines I typically use emacsclient -c to get the gui version, but occasionally it helps to have access to the command line in a terminal as well. Tramp helps a lot with quick access of remote machines but is still limited compared to having an instance of Emacs running on that machine and connecting to it from a terminal.
arthurno1 · 2022-12-04 04:37
Emacs GUI is a glorified terminal. It implementers character renderer similar to terminal but with much better graphical capabilities. You really want terminal Emacs if you run without X and possibly if you run it remotely, but otherwise I see no reason to run Emacs in a virtual terminal. Those run anyway in a X11 window, but implement much worse renderer.
nu0or · 2022-12-04 07:54
+1 for the lollipop
deaddyfreddy · 2022-12-04 13:56
> I know the benefits of the GUI in graphics and keybindings but is there feature loss or pain points when using something like vterm. what do you use terminals for? - cursed apps? you can always run them in a separate emulation session (`eshell` even has `eshell-visual-commands` customizable to automatically do that for certain commands). And sometimes Emacs alternatives are much more featureful (compare gnus/etc to mutt or tig to magit, for example). - large output? I use `detached-shell-command` for that, works like a charm. anything else?
r0flcopt3r · 2022-12-04 13:57
yikes, that sucks...
deaddyfreddy · 2022-12-04 13:59
if it's your local network `ssh -X` should work just fine
tdrhq · 2022-12-04 14:12
Sure, but I don't need X that badly. Terminal mode has a lot lower latency (while typing or when a lot of compilation logs are being printed). I'm sure it works... But at this point I'm comfortable enough with the keyboard that I don't miss the mouse.
deaddyfreddy · 2022-12-04 14:31
>a lot of compilation logs are being printed I use [detached](https://git.sr.ht/~niklaseklund/detached.el) for stuff like that, I don't want to spend my time looking at compilation in real-time (though it's possible too). Besides that, running compilation outside of Emacs makes it impossible to use compilation-mode, which is a great step forward comparing to the terminal.
Lenbok · 2022-12-08 08:58
I have found that https://github.com/CyberShadow/term-keys works really well to get all those terminal keyboard combos functioning.