21 ms·
User power, not power users: htop and its design philosophy
- ktpsns 6y agoThis is what quality software looks like: It has power features around the corner, which can be turned on by experts. But is nevertheless accessible by novices. CLI is trending amongst dev's again, and we should take a lesson by htop how to design a good user interface.
- Kototama 6y ago> CLI is trending amongst dev's again Did it ever stopped being useful?
- dspillett 6y agoNo, but it became a bit of a victim of being unfashionable. I think partly because of an influx of new devs who weren't in the position of having little choice but to learn at least some of the non-GUI way, particularly in the web sphere. As things have matured (arguably) and become more complex, and those devs have gained experience, they've started seeing the benefits of other methodologies. I just hope it doesn't swing back too far the other way as it has before (I've been around long enough to have seen the cycle previously!). I'm a big fan for command line, scriptable, tools and plain text pipe-able output, and have been since being introduced to pipes & redirection all those decades ago, but we need to avoid the holier-than-thou thing that seems to develop when our old timer ways get the lime-light for a while. It only serves to put people off learning that they are great tools for many jobs and definitively the right ones for a some.
- vinay_ys 6y agoCLI has always been in vogue. It is TUI (text user interface – ncurses kind) has fallen out of fashion. Long time back, I used to use mutt, lynx, midnight commander etc on a daily basis. In mid/late 2000s, it fell off for me. Other than top, htop, dstat and a few others, there aren't that many that come to mind these days.
- arexxbifs 6y agoI'd say TUI:s are coming back with a vengeance. Check out newsboat, nmtui, ranger, w3m, mikmod, slack-term/weechat/irssi/finch, sc, mps-youtube, micro (text editor) just to name a few... Seems to be very popular among people who use tiling window managers. In fact, with a good terminal multiplexer, mpv and fbv, all you need X for is stuff like web apps and Gimp.
- ratww 6y agoThey never stopped being useful, but at some point CLI was hidden by a lot of popular tools, like Visual Studio, Delphi, Xamarin, Xcode, Java IDEs, etc. So it was possible to program and rarely see a console. Today, even some of those tools are embracing CLIs.
- Too 6y agoThere seems to be a trend last few years where many of even the most traditional CLIs are getting questioned by modern replacements that provide a richer experience without compromising on the old values of simplicity. For example ripgrep, bat or exa instead of grep, cat and ls.
- zokier 6y agoHtop is not cli, and ncurses is in general just poor emulation of gui.
- 1996 6y agoIt's ok if you don't like TUIs, but don't call them "poor emulations" of GUIs. They do different things differently, but they achieve great results in their own ways. The mc file manager or ranger more than stands the comparison against graphical file managers.
- silon42 6y agoThe problem is ncurses / terminals ... poor keyboard support, etc...
- ClumsyPilot 6y agoLets call them what they are: a workaround to display graphical content in a terminal windows. We need them because SSH, because we linux UI is a mess, because UI is hard, in embedded, etc. In an ideal world the concept of TUI would not exist.
- simias 6y agoSometimes less is more. Having access to more features sometimes leads devs to bloat their applications and make them subjectively less usable. A pathological example for me would be gvim. I tried using it for a while but I kept running into weird performance issues and general lagginess. Meanwhile from a terminal it Just Works. So I don't bother with it anymore, I always run Vim from a terminal and I never looked back. In general I find that the terminal imposes two generally good constraints to application makers: everything must exist within a single window and mouse interaction is very limited (and not supported everywhere) so it's important that everything must be achievable with keyboard inputs. These constraints disincentivize pathological mouse-driven "click click" pop up dialog fests which are the bane of my existence.
- 6y ago
- AnIdiotOnTheNet 6y ago> CLI is trending amongst dev's again I don't know if that's as true as "GUIs are now unfashionable to devs". It is hard to blame them since GUIs have regressed so significantly ever since the iPhone.
- globular-toast 6y ago> CLI is trending amongst dev's again, and we should take a lesson by htop how to design a good user interface. htop has a GUI, not a CLI. Some people call it a "TUI" but in terms of UX and program architecture it's a lot closer to a GUI than a CLI.
- parentheses 6y ago.. and performant! Folks need to stop shipping CLI tools written in node with a million dependencies. Part of why the shell is gaining is that UIs are invariably becoming less efficient with rampant use of React and node for native apps. I did not say node is slow.
- shaicoleman 6y ago> You have no idea how many times I was asked “hey, why are some processes green?” over these 15+ years — and no, it wasn’t annoying: each of these times it was an opportunity to teach someone about threads! That's because there isn't a easy way in htop to discover that. htop is great, I've used it for a decade, but I didn't know you could hide the threads (Shift+H) until I read this today. A "View options" / "Advanced" menu item on the bottom bar would help discover these option exists. I also pressed some key, and some things turned purple, and there's no indication what view is shown, what the purple colour means, and what to do to turn it off.
- ketzu 6y agoThere is "F1 Help" in the bottom bar which lists these options, but not in much detail, so it's probably not enough for someone not experience with the tool. For example, I missed that they use capital and non-capital letters: H (shift+h) toggles the threads, but i sat there opening/closing the help screen by pressing just h. Careful reading of the help screen would have prevented that. As none of the same lowercase/capital letters are next to each other, it is easy to miss.
- loa_in_ 6y agoOn the other hand I casually looked through settings and found it immediately looking for something entirely different. Settings have a not overwhelming amount of lines each page so a quick glance led me to set whatever I wanted in the first place and things I found out by opportunity
- shaicoleman 6y agoI missed there was a "Display options" in the Setup, maybe it's just me
- rakoo 6y agoI didn't know you could click in htop until today; it even works through tmux in mosh without any special configuration. I think there's a lot to learn in the design philosophy of giving the power to users by default, but if you don't give your users the tools to learn this power they're going to have to ask questions if they want to yield it
- moobsen 6y agoI love htop. For me the design philosophy worked quite well. I learned so much about my system just by using it and trying to understand all of its output. And I am still learning after years of using it. I actually like to just sit and watch it sometimes, it's fascinating to me how much a computer does at all times, even when it is idle.
- fredsted 6y agoOne of the first things I do when launching htop on a new box is to disable threads. The current way of showing threads by default is untenable because some programs launch hundreds of threads, making it hard to get an overview of a system unless you make the terminal size very large. I appreciate the author wanting users to discover a program running amok and producing a bunch of threads (anecdote: I've never seen it happen), but there's a bunch of ways to solve it from a UX perspective: * make threads collapsed by default * add a column showing the number of threads a process has * add the threads toggle to the bottom bar for easy discovery * add a prefix to all threads, e.g. [THREAD] All of these are a lot more obvious than the color green. The authors story of having users ask him why processes are green is simply an indication that the user interface is hard to understand.
- mPReDiToR 6y agoKeep a copy of .htoprc with your ssh keys. I have a skeleton /home on my keyring for using various machines with ease.
- turminal 6y agoAnd everytime one toggles any setting that's is retained over htop restarts like tree view, the file gets edited. And you get diverging files everywhere. Annoyed me very much. Had to write a custom patch to disable some of it.
- voltagex_ 6y agochmod +i .htoprc?
- reitanqild 6y agoFor the benefit of someone like me who only uses Linux and bash on behalf of myself and the companies I work for and haven't studied it extensively, can anyone here tell me what the i is for? I wasn't able to find it in man chmod on my machine, DDG failed me, as did Google. (positive feedback to employees of DDG and Google: whenever I get assigned to the experiment where you show the snippet you thing matches my query it brightens my day, - even if the snippet shows that the result was irrelevant like here "<something about> chmod. I <something about the author>". I think Google used to nail this back in 2007 but anyways, seing the snippet in the front page helps a lot.)
- redis_mlc 6y agoIntel's powertop utility is useful for finding "hot" processes as part of performance tuning on linux.
- mPReDiToR 6y agoThis philosophy is exactly what I had with PC Tools and XTree Gold. The utilities which made computers interesting for me. Having the ability to ruin my OS (all three floppy disks of it) made learning easier. Being protected from root level commands doesn't suit me on my personal machines. "Mistakes are proof you're trying". How can you ever learn any responsibility without any power, great or otherwise?
- turminal 6y agoHtop does a good job at being a user friendly tool, but I think it doesn't empower power users the way it could.
- hyperman1 6y agohtop is one of the best tools available in your linux toolbox. Thanks, author. While thinking about it, I'd like to inject htop in misbehaving kubernetes containers. Does anyone know if there is a static compile available somewhere or something.
- Chickenosaurus 6y agoYou can use the kubectl debug command to add ephemeral containers to a running Pod. It's an alpha feature introduced in v1.18. The ephemeral debug container can contain htop while the application container doesn't. This way minimal application containers aren't complicating debugging when something goes wrong :)
- leephillips 6y agoIn my htop, user threads are not green. The only difference in the display is some text at the top telling me "414 thr". Is my setup messed up?
- C0rn3j 6y agoVery old htop versions do not distinguish threads by color. You can delete ~/.config/htop/htoprc to reset it to default settings in case it's a misconfiguration.
- herpderperator 6y agoF2 -> Display options -> [x] Display threads in a different color
- leephillips 6y agoThat was it. Thanks.
- Bridgeburner4 6y agoIt's the same for me on macOS (htop version 3.0.2). Threads aren't displayed with a different color and I also can't hide them.
- saagarjha 6y agoDoes htop on macOS even show threads?
- apple4ever 6y agoI thought I was the only one who had never seen green threads.
- saagarjha 6y agoYou should try Go.
- strogonoff 6y agoIs there a way to stop htop from listing idle processes, similar to top’s `i` function?
- parentheses 6y ago`htop` is amazing! Thank you!!
- nitsky 6y agoWhen I first started using htop, I had the opposite misunderstanding to what the author describes. I spent a long time trying to understand why there were over a dozen instances of the same process, when I thought I launched just one! When I discovered that htop was showing threads instead of processes, I hit ctrl-h to hide threads and committed .htoprc to my dotfiles so I wouldn’t have to see them again.
- CyberRabbi 6y agoI actually agree with the issue reporter. I think threads should be disabled by default. Usually I’m hunting for misbehaving processes, I care about misbehaving threads second. The default view should be as concise as possible.
- shrimp_emoji 6y ago>“stripped-down tools for mere mortals”, the latter being a design paradigm made popular by certain companies and unfortunately copied by so many OSS GUI projects Shots fired at GNOME
- intrepidhero 6y agoI'm 100% onboard with the author's design philosophy: "A good design leads a user to more powerful tools." I have not used htop but the screenshots show some things that I very much appreciate in a UI design such as the menu bar at the bottom with hot keys clearly displayed. There's no reason to make a user hunt for the hot keys or to guess at the possible function space. Software, as I think of it, is a way to expose the "general purpose" nature of computers to users. Good software teaches users how to access that nature. Like a good teacher, that leading should be subtle and gentle and have the end goal of user empowerment.
- parliament32 6y agoThe only complaint about htop is that it starts numbering CPUs from 1, while in real life CPU numbers start at 0. When I see core 18 is pegged with system(red), I instinctively want to ask perf -C 18 what's up... but that's not right, is it 17 or 19 again? If you're going to do that, don't show CPU numbers at all, just the collection of bars.
- vonmoltke 6y agoThere is an option under "Display options" to change this.
- parliament32 6y agoIndeed, but why is starting from 1 the default? Literally no other software does this except for htop, and the numbers are meaningless because they're off-by-one when you try to compare to anything else.