On Thu, Sep 1, 2011 at 7:46 PM, Bjartur Thorlacius <svartma...@gmail.com> wrote: > Şann miğ 31.ágú 2011 12:09, skrifaği Rafa Garcia Gallego: >> I sometimes use sandy in a SSH session, so I wrote some code around >> dmenu to have it work in the console. The resulting program takes >> input from stdin, reopens the tty, prints the UI to stderr, gets your >> input (again from stdin) and prints the result to stdout, so it mostly >> works as a drop-in replacement for dmenu. Stuff I don't use such as >> the multiline menu and runtime selectable colors is not implemented. >> > Why not write the UI to tty directly? Or do you suppose redirecting stderr > to null to get rid of the UI is worth supporting? >
Actually I might as well had done this. However, I had nothing to write to stderr anyways and it seems cleaner this way: the file descriptor is open and points to the tty, so why not use it?. Bonus feature: you may redirect it to another tty for -say- debugging. Anyways, I doubt anyone redirects stderr to /dev/null by default, much less for an interactive program. You could (maybe should) redirect stderr in the command you use to feed slmenu its options (unlike say for dmenu, which usually just pollutes your .xsession-errors a bit). Either way, slmenu does not print its UI until it's finished reading stdin, same as dmenu.