Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Htop 2.0 released, now cross-platform (hisham.hm)
613 points by hisham_hm on Feb 11, 2016 | hide | past | web | favorite | 153 comments



128 Cores - nice: http://hisham.hm/htop/128.png


Ok as epic as that is, if usability is desired, you can disable showing all cores and instead only show an average.


That version of Ubuntu looks very, very old.


Looks like 8.04 hardy heron, no ?


Yes, seems like it's 8.04!


Makes me jealous and pining for the 10.x days. The UI post-Unity...sigh.


...Mint?


What's nicer is that they all look fairly busy, anyone know what's running?


john the ripper?!



We are pleased that you "stole" our idea :)

Is it ok to steal back the gif? Because i think the server load is a bit to much with so many background reloads.


sure! that's the spirit of free software :)


Copied from the main site at http://hisham.hm/htop/ ?


Actually, it's the other way around - htop main site copied the idea from the post GP linked, and also doesn't display a live htop output but animates few fixed frames from said post instead.


exactly :)


It is mentioned in TFA.


Your comments are closed, but another approach would be to use Xvfb to run a terminal emulator, and take screenshots with Imagemagick.


I was just installing an older version the other day on FreeBSD, and having to mount (unmaintained) procfs was quite annoying. So after seeing this link I specifically went to their site to check what they mean by "cross platform". They say procfs won't be needed anymore.

Speaking of which, does anyone know why OpenJDK wants procfs on FreeBSD? Is this a Java thing or a problem with libraries people write using Java?


I think it is OpenJDK that want's procfs and fdescfs.


I think htop and lua are probably the two main Brazilian contributions to the open source community.


I wager Elixir counts.


Wow, had no idea Elixir was created by a Brazilian as well. Nice, thanks!


Yes :)

Here's a little bit of the story on how we create it: http://blog.plataformatec.com.br/2015/01/introducing-elixir-...


... and the main author of Lua was the PhD advisor of the author of htop. Small world :)


Thiago de Arruda started neovim.


Elixir is definitely up there!


I don't know why, but seeing Brazilians doing good on open source makes me happy and encourages me to contribute too!



Marcelo Tosatti work on the 2.4 linux kernel? Conectiva before it got merged with Mandrake?


The Clojure debugger in CIDER was written by a Brazilian. Obrigado!


pyside i think origins from same country


Apropos of nothing: does country of origin (or is it residence; or residence of the main contributors) tell us anything that is at all useful?

It seems like information - the sort people go 'oh really, how fascinating' to - but I can't really see how it's relevant.

Anyone want to chip in and make a stand for national identity or anything?

To me it's kinda like you said 'find and grep are the two main contributions to OSS from the flan-eating community'.

Yes, I should probably just keep such thoughts to myself ...

Oh and htop is awesome! Only used Lua on a Minecraft mod (and an not a programmer/CS) so can't really comment on it.


It's just a little point of interest. I don't often think about my life intersecting with the nation off of Brazil, yet I use htop every day. Now I'll probably cast my mind to a Brazilian rainforest when I do. Just makes the world a slightly more interesting place.


Thanks! Always nice when we help to make people's perceptions of places less unidimensional. Brazil is not only a place with rainforests, we also have coders! :)

(Though, even though I'm a (Southern) Brazilian myself, I used to think the whole "monkeys in the streets" here was a hoax until I moved to Rio de Janeiro and I realized they have tiny squirrel-sized monkeys running atop the power lines there!)


I feel the unidimensional thing. Australians don't actually ride kangaroos to work! There is, if I'm honest, a wallaby living in the bush that abuts my property, though.

You'll excuse me, however, for continuing to cast my mind to a tranquil rainforest rather than a Brazilian coder at a keyboard. I understand they both exist, but one is far more relaxing to contemplate than the other! :)


You're living in Rio de Janeiro? I'm sorry for you.


This is kinda what set me off, one tend to stereotype with such information - was out written on an xo laptop in a favela, in a logging camp, on a super-yacht - a country name means something, I'm just not sure what. Countries as groups of people just seem too arbitrary to me I guess.


This is a legitimate question. I'm brazilian and I constantly see Facebook posts in Portuguese highlighting "Of the top X things, Y are Brazilian!", whereas I see none or very little of that in English speaking communities.

My theory is that there are relatively few great international contributions from Brazil and we rejoice anytime we see one.


> I see none or very little of that in English speaking communities.

Are you sure? Or do you just notice it less because the place names mean less to you personally?

Palto Alto / Silicon Valley / San Francisco Bay Area (roughly the same places, right?) get mentioned all the time.

You know what's in Redmond, right? And what's in Utah? :)

Wwhen a news article talks about popular software/service being developed outside of California, they usually spend a little paragraph or so on the place (blablabla cold winters in Maine blabla data centre bla--just made that one up btw).

Greetings from the land that brought you Python, a shortest-path algorithm and compact-discs ;-)


Actually I think that a locality and a country are quite different. If instead the comment was "these both come out of Brasilia" then there's perhaps some sense - one might think that perhaps there is some local culture that's aiding this sort of development or that there might be a local initiative that's helping to create a tech hub of sorts [but it could of course just be serendipity]. But just having a country in common - suppose one main developer is in a favela using a XO laptop and another is in a high class penthouse apartment, what's the link then, why does them being in the same country mean anything, they might not even talk the same language or have the same ethnicity.

Some interesting thoughts, thanks to all for tolerating my ponderings.


Lol you should try being from Iceland


Iceland has Sigur Rós. Don't be greedy.


I think it's cool to see how these things are spreading round the world, and it's not just the US that creates useful software.


I really enjoyed this talk[1] by Bryan Cantrill, part of which is about what it took to emulate Linux's syscalls from within SmartOS. It's lengthy, but enjoyable.

One of the applications that they tried to port directly to before the emulation layer was htop, and he has a good rant about what that took because of its use of /proc and how that made porting it very difficult.

Given that, I'm sure this wasn't easy. Kudos!

[1] https://www.youtube.com/watch?v=TrfD3pC0VSs


Cantrill loves to rant, don't he?


He does and he's good at it. It's usually pretty entertaining.


I used to use htop, but switched to glances at some point, because of a quicker-to-find-the-info-you-want interface.


I use htop. I tried glances as I heard good things about it. It is nice, I like how it has more stuff -- disk, network. However it installed matplotlib, fonts-lyx, tk8.6, libjs-jquery-ui, python3-bottle, and a slew of other dependencies, not a big deal but something to watch for.


Were you adding it through apt-get or pip? With apt-get it's fairly painless.

    apt-cache depends glances

  Depends: python-psutil
  Depends: <python:any>
    python:i386
    python
  Depends: <python:any>
    python:i386
    python
  Depends: python
  Depends: python-pkg-resources
  Depends: adduser
  Depends: lsb-base
  Recommends: python-jinja2


apt-get. It was painless, and I have the diskspace so not a big deal. Looking at package properties I see it recommends a bunch of packages, so it installed those and their deps (this is Ubuntu 15.10):

    hddtemp, lm-sensors, python3-docker,
    python3-bottle, python3-pysnmp4, 
    python3-influxdb ...


optional dependencies are optional for a reason, no real reason to bring it up as a con.


I just described by experience of installing it. It wasn't a huge issue, I installed them anyway after all.


i just use terminals though, web-ui-everything is nice but also not all that convenient IMO since you need to forward ports 'n stuff.


With services like ngrok the need to port forward isn't as big.


Awesome! Installing htop is the first thing I do on my *nix systems. The update is still not up on Homebrew, shouldn't take long though.


Perhaps you're referring to Linuxbrew - "a fork of Homebrew, the Mac OS package manager, for Linux."

It exposes the same repository as its OSX counterpart, with linux-flavoured customisations where necessary.

From feature list at http://linuxbrew.sh/

- Can install software to a home directory and so does not require sudo

- Install software not packaged by the native distribution

- Install up-to-date versions of software when the native distribution is old

- Use the same package manager to manage both your Mac and Linux machines


Nope, I am talking about Homebrew, it provides the best way to install htop on OSX.


The htop package on Homebrew is a fork of the original for OS X called htop-osx.

https://github.com/AndyA/htop-osx


Didn't know that! Thanks for sharing.

I hope the fork will be deprecated now for the official one. There's already a related issue on the repo.


FWIW, I did an install from source and it was totally painless--no dependencies to track down. ./configure, make, sudo make install and you're done.


Cool, thanks for sharing! I'll still prefer waiting for a Homebrew update, too addicted to the comfort of package managers :).


I wonder if this can get into Ubuntu 16.04 before feature freeze in a week or so..


It's not a default package, right? If so it can be updated in the repos.


htop is an amazing upgrade to plain old top. Thank you for your work on this!


Agreed. And it's fun running it on a box with 32+ cores.


Is there a quick way to avoid having all those cores take up the top 32 lines of the screen?

Checking my 40 core machine in a typical terminal window, I can't see any of the processes, just 40 lines of CPU! Thanks.


If you press F2 you can change the setup for the top meters and switch it out with CPU average or other combinations of cores.


...or if you're not the interactive type (or deploy untold millions of images), edit .htoprc .

Hm. Given the opacity of that config file, I went the way "configure interactively, then roll out the new .htoprc"


Really? Recent versions shouldn't take more than 10 lines for 40 cores. It displays them in 4 columns.


With 320 cores you can't see anything.


Hmm... and I use it on a 32bit netbook...


Hehe, I once tested a MPI program intended for a supercomputer on my 2-core ARM chromebook.

It ran. It was not very fast.


Yes, it is hard top something called top, but htop does! It is a must have.


I love htop! I hope homebrew gets it soon. Mine only says version 0.8.2.8? I donated $5 to the developer. Thanks for htop


For others interested in donating: http://hisham.hm/htop/index.php?page=donate


I just compiled. I runs successfully.


Thank you! :)


Huge htop fan. Honestly probably my favorite unix utility.

Just did `brew update && brew upgrade` but not seeing an htop update. I am still running htop 0.8.2.8 via brew.

Also tried on an AWS server running Ubuntu, same thing `apt-get update && apt-get upgrade` no new htop version available. Running htop 1.0.2.


Looks like two^Wthree people have already raised PRs for getting version 2 in Homebrew[0]

[0] https://github.com/Homebrew/homebrew/pulls?utf8=%E2%9C%93&q=...


I hit the same thing, so I figured I would try compiling from source.

I built ncurses 6.0 from source (installed to $HOME/local) and then htop 2.0 (also to $HOME/local) and it worked a charm. This was on a clean (took it out of the box today) 10.11 system.


Ehhhhhhhhhhhh, really want to stick with using native package managers (brew, apt). Did you just add htop to the apt exclude?


Ack, my bad. I meant OS X 10.11 (El Capitan). Same should probably work on any Linux distro with standard build tools installed.

I keep a ~/local directory with built-from-source programs in it. That way I don't get any conflicts with system-wide package managers.

Configure line for ncurses:

  ./configure  --enable-pc-files --with-pkg-config-libdir=$HOME/local/lib/pkgconfig --with-shared --prefix=$HOME/local
  make -j8 && make install
And for htop, a regular configure worked fine:

  ./configure --prefix=$HOME/local
  make -j8 && make install
A quick check in my .bashrc (actually .zshrc) prepends $HOME/local/bin to my $PATH if it exists.


I too would like to know how to install via brew.


I quickly and hackily did `brew edit htop` and made these changes to install htop 2.0: https://gist.github.com/bmorton/231bc3d6b3aa6fbefd48

I've got it on my list to fully fix it up and submit a PR, but feel free to flesh out my changes and submit instead :D


woohoo! ProTip: Even older versions of htop have mouse support. You can click on columns the change sorting for example.


My favorite top replacement. Keep up the good work!


Has anyone got mouse wheel support working on a PuTTy terminal? I've compiled htop from source against ncurses 6 on Ubuntu, but no luck.

I know it sounds like I'm asking a lot for a PuTTy window... but mouse clicks have (amazingly) worked even on a very old version of htop. Just wondering if anyone has done it before pursuing it further.


I don't suppose this finally allows sorting in tree view, does it? That's been a feature I've been wanting forever.


Tree view is sorted by pid only, sorry. I'm afraid moving entire subtrees based on other criteria (such as CPU%) would make the screen unbearably jumpy.


Is there a way to combine all the processes with the same command name?

I have a ton of mariadb processes (I don't even know if this is normal, but it seems to be working just fine) and it gets tiring having to scroll them just to glance the numbers on other processes.

https://www.dropbox.com/s/ghwsh6ye1gt32k1/Screenshot%202016-...


Those might be threads. It's best to disable showing threads (F2 - Display options - Hide kernel/userland threads) because they give little information over just the process.


Thank you so much.


On tree view (F5), you can collapse and expand sub-trees (with "+" and "-", or just click twice on them).


The processes may be forks. Java does this too. Try pushing F5 and see if that cleans things up.


Wouldn't braille characters also make nicer progress bars? I think they look more dense then a bunch of ||||


They look denser (could add two "lines" per character), but wouldn't be able to change the colors of these lines individually. Having said that, we use braille charecters when in "Graph" mode (F2 Setup > Meters > pick a meter > press Space until it goes to [Graph]).


Braille characters, or just colons and full stops?

  [::::::::....        ]
  [::::::::::......    ]
Could you give an example of the braille characters being used in this way?


I was just thinking that using braille characters would fill more area on the screen. In particular, | characters look very thin. A bunch of widely spaced green bars |||| is functional but not very appealing.


Or perhaps some box-drawing characters (though they may not have the support that ||||| does)


Yep! Perfect! Now I don't need to do some kind of magic :) when installing on my FreeBSD servers. Congrats!


That slide design is really great.


Thanks! :D


Ok so I know of and have tried top, atop, htop, ntop. What else is out there??



iftop for network stuff

"iotop -o" is also useful, for seeing if that process is actually writing to disk

powertop is a great utility for improving laptop battery life - it highlights the things you need to adjust to reduce power usage

pgtop for postgres, but I've never used it

not "top"-branded, but lnav is an ncurses-based log navigator that's partially comprised of magic

and, of course, there are many varieties of "desktop" cough


systemd-cgtop lists CPU usage of systemd units instead of processes.



slabtop if you're into kernel development and low level debugging


dstat, the best one imho. Can replace quite a few of the other tools.


tfa mentions vtop, which is a node.js version of top


iotop


This is really timely... I just got my new MBP today, so I've been installing all of my standard tools. Luckily I saw this before I used Homebrew to install htop!


Oh the vtop inspired bar is def cool!

regular top has been catching up though and while htop is different and perhaps still better, regular top does the job for me in most cases.


It might depend on which top (BSD,GNU,?)


gnu of course ;)


Were they able to improve the conf file and color selection? I remember that was one area that needed work. 256 colors would be nice also ;)


When I gave up to get it working properly on FreeBSD, I see this news. Great news.


Just now downloaded and compiled it on FreeBSD. Works as expected. Haven't used htop 1.x on FBSD so can't offer a comparison.


This is one of the first things I install on any new Linux system. Amazing tool.


My biggest feature request is better search workflow (perhaps like Vim, instead of having to press F3) and ability to filtering/grep the list of processes when searching.

I am installing version 2.0 on my laptop to see if search has changed.


Does that mean that it now works on OSX without root?


Works for me. Had to build from source (couldn't find an OSX binary), but it compiled without a single warning, which is probably a record for something not OSX-specific. make install still requires root, of course, but it runs fine from the build directory.


htop has always been in my list of tools to install on server. Thanks for this great upgrade.


Woohoo! This is great.


<3 happy top


still no vi keybindings?


Still no Windows though.


Haha everyone used to mock MS because cross platform to them meant Win16 AND Win32. Now we use it to mean various flavours of Linux. Progress?


> Now we use it to mean various flavours of Linux.

?

"Portable" htop 2.0 works on FreeBSD[0], OpenBSD[1] and OSX[2], not just "various flavours of linux".

[0] https://github.com/hishamhm/htop/tree/master/freebsd

[1] https://github.com/hishamhm/htop/tree/master/openbsd

[2] https://github.com/hishamhm/htop/tree/master/darwin


Back in the day it wasn't unusual for something to support 30-odd variations on Unix, plus VMS and Windows. ./configure && make && make install. Those were the days!


It also works on various BSDs and OS X in addition to Linux.


I'm pretty sure it worked on most Linux distros and even on mac. I don't see how it's big news.

That's not progress, it's just faulty marketing.


Mainline htop never worked on OSX. OSX's htop is a fork of 0.8.2 with all the linux stuff stripped out and replaced, and then not really updated (let alone resynced with mainline): https://github.com/AndyA/htop-osx


It might not be hard to implement now, with the OOP-ish structure of the project. Cygwin is mentioned in the slides.


To be fair, it is still only for POSIX-y systems. Not cross platform in the conventional sense.


Working on different unix-like OS is cross-platform in a completely conventional sense.


Great !! hisam_hm

you help me drop one of my alias function now :D

̶e̶n̶v̶o̶f̶ ̶(̶)̶ ̶{̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶s̶e̶d̶ ̶'̶s̶/̶\̶x̶0̶/̶\̶n̶/̶g̶'̶ ̶/̶p̶r̶o̶c̶/̶$̶{̶1̶}̶/̶e̶n̶v̶i̶r̶o̶n̶ ̶}̶


If it did not try so hard to emulate nmon poorly, I'd use it more.


Wait, where are the Windows binaries?

Oh, I see. They trying to be smart and say "cross-platform" because now it runs on more Linux distros. That's not smart, that's faulty marketing. And AFAIK it already was running on 90% of Linux and also on MacOS.


"Until it supports MY specific OS, it's not cross-platform, wah wah wah!" In this way, there is no cross-platform program at all, because there's always something that's not supported. How is Windows a measuring-stick of compatibility for UNIXlike tools? (And why would this ever be useful on Windows, which has completely different way of managing processes?)


I don't even use Windows. I'm just sayin' calling something cross-platform when it doesn't support most used OS is wrong.


I very much doubt that Windows is the "most used OS" where console applications are considered. That's just like saying "why do you call this airplane engine cross-platform when you can't even use it on a car? I don't care that it fits most airplanes, there are far more cars!" Different purposes.


No, it's accurate marketing. Asking for htop to be available on windows is kinda silly if you recall that htop is "top++" and depends on having a unix filesystem.

"Cross-platform" is a contextual term.


> depends on having a unix filesystem.

It doesn't do that. Before the multiplatform changes it did depend on having procfs (linux's I assume since BSDs had a non-identical procfs yet weren't supported), aside from the OSX fork which ripped out all the /proc access and replaced them with OSX API calls.

What it does depend on is ncurses.


Ah, thanks for the correction. I had no idea it wasn't using procfs anymore, or that darwin was using something very different. TIL :)


> I had no idea it wasn't using procfs anymore

It still uses procfs for Linux (since that's there by default), but not for the other ports. Consider Platform_getLoadAverage for instance:

* linux uses /proc/loadavg[0]

* freebsd and openbsd use sysctl({CTL_VM, VM_LOADAVG})[1][2]

* OSX uses getloadavg(3)[3]

[0] https://github.com/hishamhm/htop/blob/master/linux/Platform....

[1] https://github.com/hishamhm/htop/blob/master/freebsd/Platfor...

[2] https://github.com/hishamhm/htop/blob/master/openbsd/Platfor...

[3] https://github.com/hishamhm/htop/blob/master/darwin/Platform...


Why does it depend on having a unix file systems ? (note that it doesn't use /proc on e.g. freebsd)


BSD is not Linux. htop now supports several different Unices.


it is a big news - it really is cross-platform - OS X version was really outdated


Using it on my Mac every day and didn't even notice that it was outdated. But thanks for info.


The OSX version is/was a fork of htop 0.8.2


And there was no BSD version.


Well, it did run on FreeBSD, with a requirement to mount procfs :)




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: