Questions about windows support
H. S. Teoh
hsteoh at quickfur.ath.cx
Tue Feb 21 17:27:22 PST 2012
On Tue, Feb 21, 2012 at 07:27:41PM -0500, Nick Sabalausky wrote:
> "H. S. Teoh" <hsteoh at quickfur.ath.cx> wrote in message
> news:mailman.826.1329869015.20196.digitalmars-d at puremagic.com...
> > fg/bg is the best thing on earth since sliced bread. Well, to me. :)
> > It lets me fire up my (text-based) mail client, read mail halfway, find
> > someone mentioning an obscure library function, press ctrl-Z to suspend
> > to mail client, `man obscure_function` to find out on earth they're
> > talking about, then fg to continue reading mail.
> Yea, see I think the reason I almost never use it is because I'm still not
> used to having it available. "When all you have is a hammer..." So I
> instinctually just fire up another window, another connection, or another
> whatever, whenever I need to multitask.
It goes the other way too. When I use my wife's Windows laptop, I keep
trying to ctrl-Z to background what I was doing, and I keep wondering,
how do I get the list of backgrounded tasks so I can get back to that
other thing I was trying to do?? :P Scarily enough, sometimes ctrl-Z
actually works... 'cos I'm usually on putty when using Windows. :P
> Not sure if I'll actually end up kicking the habit of avoiding it
> though. I've spent years on systems (including Windows) with multiple
> desktops available in the taskbar, and I always ended up just using
> one of the desktops. I always liked the idea of multiple desktops, but
> using more than one just meant spending more mental effort on
> organization and "What the hell desktop did I leave that window on??".
> heh :)
Yeah I tried multiple desktops for a while, but after a while it was
just too hard for my little brain to keep track of where things are.
Some WMs try to help by displaying a little desktop map in the corner,
but it doesn't help when you have large windows obscuring small ones
Eventually I gave up and went the other extreme: ratpoison. No mouse,
no window title bars, in fact no overlapping windows (except modal
popups), everything is maximized to full-screen, and you switch between
them with keystrokes (which if you keep them <10 in number, you can
address just by doing ctrl-T [0-9]). Remembering a number is easier than
remembering a location, and at least you can see a simple numbered list
when you ask the WM for it, not some jigsaw puzzle that you've to solve
on the spot to find that window you minimized who knows on which other
But I wouldn't recommend ratpoison to anyone except rabid hardcore CLI
geeks like myself. Most people cringe when they see my "desktop"
environment. "*That's* your OS?!" they would exclaim. It's just a wall
of text. And then I would flip between a few windows, do some fg's and
bg's, and they'd be completely lost. "What on earth did you just do?
What's all those letters and symbols mean?" My wife sometimes asks me,
"Do you really understand all this stuff?" when the screen is busy
scrolling past during a large compile job. "How do you read all that
stuff so quickly anyway?!" :-)
> > Yeah. And worse yet, I've actually encountered GUI Linux apps that
> > expect input from stdin. I'm not kidding. As they say, fact is
> > stranger than fiction.
> Eww. That's just...wow.
At least it's no worse than this one time, I had a browser plugin go
*really* wrong, and it launches mplayer which somehow believes that it's
being launched from a terminal instead of X11, and then it tries to read
from the *browser's* stdin, causing the browser to get suspended by
SIGTTOU, but when I try to fg the browser, it auto-backgrounds itself
'cos it wasn't designed to read from stdin. Or at least, I *think*
that's what happens. Who knows. Something in there somewhere has gone
completely wrong, so now *both* the browser *and* the plugin that
launched mplayer are stuck in this limbo of trying to read stdin but
it's not actually possible to type anything into it. :P
> >> The whole Unix philosophy is orthogonality, one tool to do one task
> >> well, no duplicated functionality for slightly-different use cases.
> >> The whole "sudo" vs "gtksudo/kdesudo" thing seems to be some sort
> >> of big ugly hack.
> > It's to prevent people from doing foolish things like logging in as
> > root and doing everyday tasks as root, just because one or two
> > commands *might* require root privileges. It's convenient, it's like
> > Windows and DOS where you can do pretty much anything without this
> > troublesome protection thing.
> Oh, no, that's not what I meant. I understand the need for sudo, and
> I'm totally in favor of it. What bugs me is why we *also* have
> "gtksudo/kdesudo". Ie:
Ahhh, I see. Mea culpa. :)
The reason is because that monstrosity known as X11 decided to trump the
original Unix design, and implement a security protocol of its own. I
won't get into the gory details here, but basically the usual su/sudo
does give you root access, and the GUI app is actually running as root,
but it needs to connect to X11 via a socket, and the X server has no way
of knowing if the process it's talking to over the socket is running as
root or not. So it asks for authentication tokens which root doesn't
have, 'cos they're sitting in the original user's $HOME somewhere, but
the GUI app doesn't know this, so it tries to look in root's $HOME and
That's where gtksudo (or whatever it is they call that monstrosity)
comes in: it not only gives you root access, but also sets up some
environment vars in root's environment so that GUI apps launched from
root will actually be able to find the original user's X11
authentication tokens (and possibly some KDE/GTK-specific stuff as
Yeah I know. Wayyy over a newbie's head, for no good reason at all.
Give me some fresh salted fish, please.
More information about the Digitalmars-d