6 ms·
Application-specific terminals
- panki27 3y agoOr use a terminal multiplexer like tmux instead of "terminal tabs". Never leave the terminal, except for the browser.
- cweagans 3y agoMy terminal emulator has tabs and splits and saved sessions already. That doesn’t really solve the problem though. I want something that I can cmd+tab to and not dig through a pile of tabs.
- panki27 3y agoI auto rename the tab to the program that is running currently. So visually scan the window list for vim, then hit the prefix followed by the number of the window. But if you really need alt-tab, I can see why this won't work (unless you manage to integrate tmux windows into your window manager).
- neilv 3y agoMy `xmonad.hs` has key bindings like this, to switch to a window with a particular program running in it, or start the program if it isn't running: ((mod4Mask, xK_p), raiseNextMaybe (spawn "urxvt -name htop -e htop") (className =? "URxvt" >> title =? "htop"))
- politelemon 3y ago> Kitty also had a command line flag to allow setting the window class That's quite fortunate/fortuiutous and makes for a nifty shortcut that works so well. Is this common for all terminals, eg does gnome-terminal have a --class that would let it slot in to this .desktop setup? Tbh the Mac version looks a bit too involved and hinges on or works around specific behaviors, I'm not sure I'd want to go that far as it then ventures into the territory of 'maintenance'.
- friend_and_foe 3y agoWell if you want to do this with a terminal that doesn't you can just use a pipe.
- padthai 3y agoWould you mind to elaborate? It is the first time I hear a pipe can be used for setting the class/title.
- friend_and_foe 3y agoNo I mean, opening a terminal window with a program running in it. Pipe the command to the terminal when you run the terminal. I do this for TUI apps on my Sway desktop, just put some bash scripts with a single line in them, they're my shortcuts so I can run them from my menu.
- eadmund 3y agoA lot of older X11 apps support -class for this. I use X window classes to differentiate between all of my Firefox instances. No idea if Wayland even supports the idea of window classes (so that I can raise the instance I need with a single hotkey), but if not that’s yet another blocker for me.
- cycomanic 3y agowayland has app-id, which is sort of equivalent. IIRC most modern terminals set the app-id when you use the --class (or similar) flag on wayland.
- cweagans 3y agoMost of the terminals that I've looked at have a `--class` flag (gnome-terminal, wezterm, alacritty, and kitty all have it). https://github.com/fmoralesc/neovim-gnome-terminal-wrapper https://github.com/fmoralesc/neovim-gnome-terminal-wrapper also exists if you want to go that route. I tried it for a little while and it worked pretty well, but it's not particularly easy to re-use for other applications. The mac version is a bit of a pain to set up the first time, but it's pretty straightforward after that!
- eviks 3y ago> Third-party GUIs can be nice, but they generally provide very little value over a TUI What value does this messy method to reimplement GUI bring?
- friend_and_foe 3y agoYou can run them remotely over SSH, for one. I also like the fact that it's hard to build a terminal application that needs a mouse. I don't want to touch a mouse if I can avoid it, so I run them. A personal computer is too powerful to operate with a single finger. There's the low resource aspect too. Sure, you can build a TUI that hogs resources, but there's a culture of not doing it, and it's harder to do it even if you try. Contrast that to modern GUI software where it's like the developers look at the minimum requirements as a speed limit, that is, the bare minimum you have to use.
- eviks 3y ago>A personal computer is too powerful to operate with a single finger. You might've forgotten due to no use, but mice don't use only 1 finger, and they don't prevent keyboard use either. The comparison to some general GUI state also doesn't make sense - that class of software is miles ahead of the TUI in terms of functionality, so you'd need to limit the comparison to apps that are functionally similar
- friend_and_foe 3y agoI've found that with keyboard oriented interfaces the TUIs are as or more functional than GUI apps. And sure, having a mouse doesn't preclude you from using a keyboard, but GUI applications are so mouse focused it's impossible to use most of them without a mouse. The 1 finger comment was hyperbole, but it's close enough to true.
- eviks 3y ago> it's close enough to true. I use various buttons and wheels and gestures and click sequences (LR switch tab left, RL switch tab right) and buttons-as-modifiers on a mouse, so not even remotely close The other point is repeating the same generalization mistake, "most of them" don't even exist in a TUI form, and the level of keyboard customization for keyboard focused interface is often pretty lackluster in a TUI (terminal text editors famous for their customization can't differentiate between left and right modifiers and it's harder to fix that with an external utility because, guess what, it's not a separate app, so usual app detection fails!)
- Steltek 3y agoI went through a phase like this a long time ago. Mobile kills the entire idea. Sure, you can get Termux or an ssh client going but then what? It's not like Mutt has a hidden touch friendly interface implemented through vt100 codes. The modern 2023 guide would be discussing how to spawn PWA/webapp windows and integrate them like Android and ChromeOS.
- cweagans 3y agoI'm not sure why mobile kills this idea or why it even matters. I'm not going to be running neovim or mutt on my mobile device because I don't often use a mobile device to write a substantial amount of code or do anything beyond surface-level email triage. The next version of Safari has the idea of installable web apps on macOS. Chrome has had that functionality available for years. There are also a number of third party apps for macOS that handle creating app bundles that essentially just run web views (e.g. Fluid, Bulldock Browser, etc).
- fiddlerwoaroof 3y agoI have used prompt/blink + mutt (now emacs/notmuch) to read mail for a long time. It’s a great setup if you use vim-style keybindings.
- PappGaborSandor 3y ago[dead]
- cespare 3y agoI've done this for a few years as well. I use a terminal+tmux for most work including quickly editing files here and there but for some reason when I get to "proper" focus-mode programming my brain just wants a separate "application" to look at. And usually the terminal is on my secondary monitor while the "editor" terminal is full-screen on the main monitor. I used to gvim but realized that I was getting almost no benefit (and occasionally the differences between gvim and my terminal caused minor annoyances). Two things I do that help in this regard: I use a tweaked config for the "editor" instance of the terminal that has a slightly different background color from my main terminal. This keeps them separate in my mind. I use dedicated shortcuts for focusing each application I use (browser, terminal, slack, etc) and the "editor" terminal has its own shortcut. (The --class flag that the post mentions kitty has would be pretty helpful in this regard. My terminal doesn't have that so my shortcuts are based on title, which works well enough most of the time.)
- Pingk 3y agoI feel like I'm misunderstanding something? The main complaint was having to dig through terminal tabs to find your vim and not being able to Alt+Tab to it. Surely just detaching that single tab would work just fine? Their solution seems to add a lot of complexity for not much benefit...
- deleted 3y ago[deleted]
- quicklime 3y agoThis is more about “Cmd+Tab” on app-oriented desktops like macOS or gnome. In these environments, cmd+tab will switch applications, not just windows, and this person wants neovim to be there alongside whatever other apps they run (eg safari, Finder). There’s a similar problem where some people don’t like to search for email or chat tabs, so they install a “native” (electron) app like teams or slack so that it acts like more than just another browser tab.
- BaculumMeumEst 3y agoWhy do we keep doing this shit to ourselves?
- the_gipsy 3y agoJust use a window manager that offers something better than alt-tab. This works for any window type, e.g. specific browser windows etc. Imagine having to use a different browser just so that your OS allows you to switch with a shortcut...
- sigmonsays 3y agodesktop linux user here, I use i3. A tiling window manager allows me to always have my terminal on the right workspace that's 1 key away. Op should just invest in setting up a little workspace with a hotkey. I'm sure the same is possible on windows or mac as well.