4 ms·
One of the biggest upsides of TUIs over GUIs is that I can run any number of TUI instances. Meanwhile a GUI's developer has to decide to grace me with the abil
by hombre_fatal 2mo ago
One of the biggest upsides of TUIs over GUIs is that I can run any number of TUI instances.
Meanwhile a GUI's developer has to decide to grace me with the ability to even open more than one window. "A tabbed interface will be sufficient!" -- yay, I'll never be able to view two screens of info at the same time.
- brainwad 2mo agoOpening more than one instance is the default, developers have to actively work to block it. At least on desktop.
- hombre_fatal 2mo agoWhich desktop? It's not true for AppKit, SwiftUI, GTK, Qt, WinUI, or Electron, and I'm not sure what's left.
- annapanna 2mo agoWhat? 99% of my programs I can open more than one window by just executing the program as normal multiple times, the only ones that enforce a kind of singleton execution are things that also acts as a kind of server, one example is Everything search, but it has a "Open new Search window" for multiple windows. And that is the default, you have to explicit code in a lock/global mutex thing to block multiple instances. vscode, electron app, no problem opening multiple windows. Geany, gtk app, no problem opening multiple windows. Can you give an example where this doesn't work?
- hombre_fatal 2mo agoAnything from WhatsApp to the Settings app on macOS where I might want to, say, compare the wifi network settings for two access points. But the point is that the developer has to build the app in a way that lets you do this. Once again, there is no default with the tools I listed. You decide on how you want windowing to work and then build it. At this point, show me examples of needing a mutex to "block" a multi-window default.
- ksbd-pls-finish 2mo agoI don't get it. Let's say you create a game.exe, a windows application with a single window. User double clicks on game.exe icon on their desktop, and the window opens. User double clicks the icon again, and the game window opens again. If the developer want to prevent two instances of game.exe running at once, they need to actively detect and prevent this behaviour. Just like you can start vim several times you can start gvim several times and have a few windows. This is the default behavior, and if the developer wants to change this for some reason, they need to put in some effort. Maybe macOS is special? I'm not familiar with this platform.
- zarzavat 2mo agoNot on Mac OS, opening more than one instance is undefined behaviour. It may work, but it may also corrupt your data.
- orbital-decay 2mo agoHuh? None of these force single-instance by default
- hombre_fatal 2mo agoThey don't do anything by default. The developer makes it do what the developer wants (not the user). You claimed the developer has to "actively block it" which isn't the case. Even in SwiftUI which has the simplest way to support multiple windows with zero work, the developer has to use WindowGroup, and if they didn't then you don't get to open more than one window.
- orbital-decay 2mo agoI did not claim it (another user did), but I think your reaction captures the overall sentiment ITT, which is taking perceived status quo as some fundamental thing and defending the worse solution instead of changing the status quo. If all that energy went into perfecting GUI apps the way you want them to work, the ecosystem would have been much healthier. I've seen it in Electron already, and TUI apps are headed the same way, it's simply inevitable. The JS and Python bloat and fragmentation of conventions are already there, reinventing things that used to be simple in a complex way is next (in a way it already happened, e.g. a ton of basic things like hotkey schemes have to be reinvented from scratch each time in TUIs).
- hombre_fatal 2mo agoI don't understand what you're responding to. TUI apps are multi-instance by default since the user can invoke the program in different pty sessions. The developer would have to actively fight that. GUI SDKs generally require the developer to pick a solution. And it's easier to default to the simpler solution where you have one instance, one data model, one window. Whether things might change in the future isn't relevant because we're talking about how things are today, not speculating about the future. And the time to change one's opinion is when reality changes, not ahead of time based on how you think things hopefully will be.
- tom_ 2mo agoIt's standard for Windows. Double click a .exe, and a new copy loads and runs. If it wants to quit because there's an existing instance running, the code has to arrange for that itself. (It's possible Qt does this for you by default. Depending on the app, this can simplify some things, sometimes! Maybe WinUI is the same.) It looks like macOS Finder tries to make it difficult to run two copies of a .app simultaneously, so I imagine many programs don't check for this case, but this is Hacker News, so we can use our hacker skills to try and do what they don't want us to: find the exe inside the bundle and run it directly from Finder, or run it from the terminal using its path. (This works for me with Ptacek's mdv app. Two copies of it end up in the dock.)
- dunham 2mo agoElectron requires effort to get single instance. I've had to implement it. You need to call this: https://www.electronjs.org/docs/latest/api/app#apprequestsingleinstancelockadditionaldata https://www.electronjs.org/docs/latest/api/app#apprequestsin... and handle this event: https://www.electronjs.org/docs/latest/api/app#event-second-instance https://www.electronjs.org/docs/latest/api/app#event-second-... I believe macos is the only OS that enforces single instance by default. If you start xterm five times on linux, you get five independent xterm processes.
- okanat 2mo agoI don't know much about macOS. I only used other people's stuff and navigating it is really hard for me. You're wrong about GTK, Qt, WinUI and Electron though. They default to "do nothing" which eliminates the ability to even know that another instance exists. You have to manually program that.
- underdeserver 2mo agoBut in the article all these GUIs are vibe coded. Tell your AI to allow more than one window. What's the problem?
- hombre_fatal 2mo agoThen you'd have to contend with the rest of the list of TUI advantages over GUIs, like trivially operating them as they run on remote machines.
- underdeserver 2mo agoThat is, as TFA mentions, the one good argument.
- hombre_fatal 2mo agoWell, it depends on what you want. I'm glad the Claude Code TUI runs in my terminal, for example, because that's where I do software development and interact with the file system and run other lightweight keyboard-driven TUIs that I want to use moment to moment. Imagine if there were no terminal/pty system. Then what, I'd have to use Claude Desktop (doesn't support multiple windows) and Finder? So no, it's not the only argument for TUIs.
- CamperBob2 2mo agoThat's what RDP, VNC, etc. are for. They are usually tied to specific user accounts, it's true. But that's something some people made up, and it doesn't have to be that way.
- yencabulator 2mo ago`waypipe ssh HOST COMMAND` is darn simple.
- mike_hearn 2mo agoOnly if the program is designed to be safe to run in parallel. Which can be done with desktop apps too - and they'll run more efficiently as well, as the windows share memory.
- hombre_fatal 2mo agoGUIs have their benefits. You can make much richer UIs with much nicer UX when you're not limited to a grid and whatever paradigm you can hack into the ancient tty stuff, and when you have access to raw keyboard scans. But I don't think I've run into a TUI that I couldn't have multiple instances of.
- fmorel 2mo agoI hate that you can only have one window of the Windows Settings app now.
- MintPaw 2mo agoWhy would this be true? The way "single instance mode" usually works is by taking a global mutex or making a lock file. What makes this not possible for TUI apps? Isn't it just culture?
- MereInterest 2mo agoMy guess is that is because a TUI can’t give focus to the existing instance. When a GUI application realizes that an instance is already running, it can ask the windowing manager to unhide and focus the running instance. For a TUI to do the same, it wouldn’t just need to find and focus the window, but would need to trace it through the myriad ways that a TUI can be displayed. I may run a TUI inside a docker container, as part of a tmux session, over ssh. If a TUI somehow managed to focus the existing instance through those layers of wrapping, I would be very surprised, disgusted, and impressed. So I think it’s that the end goal of “redirect user to existing instance” is infeasible, so nobody bothers to enforce a single instance, since the rest of the steps aren’t possible.
- yencabulator 2mo ago> a TUI can’t give focus to the existing instance Emacs Server and tmux would both like a word. Make the current tty show the app output.
- globular-toast 2mo agoOn the contrary, multiple windows is normal and the default but tabbed interfaces became popular due to bloated GUI design. This is all down to design and not due to it being a GUI, though.
- deleted 2mo ago[deleted]
- porridgeraisin 2mo agoThe other thing is, I've had "computer use" on my LLMs since way before they had vision and macos integration. Since in TUIs both control and data is text, they can simply send text to a pty. There is an opencode plugin for this opencode-pty. Terminals + browsers is all I want for most apps. Native GTK/QT is really good, but I only want it for "system" things like a clipboard manager or file manager settings app and things like that.
- WhyNotHugo 2mo agoTUI developers could implement the same kind of anti-features. This isn't a trait of GUI vs TUI.
- c0balt 2mo agoBut they generally don't because it us often expected to be able to have multiple open at the same time, e. G., with lazygit.
- Mesopropithecus 2mo agoIn TUI, you almost always open a new process when your start a new instance. Pretty much all GUI frameworks I have worked with behave the same, and you have to actively create singleton behavior. Then you have Mac OS which makes it hard two create multiple processes of a GUI app. Other OSs don't necessarily behave the same.
- arjie 2mo agoThat’s interesting. The browser is also a host of multi-instance applications which makes it a good platform for this. The ChatGPT web app works better with multiple tabs than selecting its in-app sessions in a single tab. Good observation.
- boinCloud 2mo ago> I can run any number of TUI instances. https://en.wikipedia.org/wiki/Tab_(interface) https://en.wikipedia.org/wiki/Tab_(interface) Same with docker containers Same with concurrency Same with Notepad Same with exec Same with bsd jails Same with copies of data in a for loop Same with recursive functions Same with numerous copies of image viewers showing the same jpg and txt files ...it's all arbitrary containers and arbitrary recipes to encode and decode binary