Can someone else confirm this bug on another Linux system, preferably a modern one that uses systemd?
In X, as non-root:
open a term (call it term1) open another term (term2) type "tty" in term2, not your tty number/string in term1: type "write <your-login> <tty-string-from-above>"
replace your-login with the output of "who" if you don't know who you are logged in as
please try both /dev/pts/42 and pts/42 format for the tty part of write
example: write trevor pts/42
When I run this I get: write: trevor is not logged in on pts/42
Even though I clearly am. This used to work perfectly up until last year (I think), and I think systemd changed something (big surprise). No chatter about this anywhere that I can see. Probably the last person on earth to use write (at least on F24).
I found some other things to test that indicate that something is really amiss:
write trevor
write: trevor has messages disabled
mesg
is y
mesg y
mesg is y
write trevor
write: trevor has messages disabled
ll /dev/pts/42
crw--w---- 1 trevor tty 136, 42 Jun 28 02:48 /dev/pts/42
If someone else can confirm this bug on a non-Fedora (or a newer one) that would be great. If someone can also confirm that the above behaviour is insane, that too would be great. If anyone has some ideas on what to try next, shoot away! Then I'll file a bz. Thanks!
On 28/06/2017 2:51 AM, Trevor Cordes wrote:
Can someone else confirm this bug on another Linux system, preferably a modern one that uses systemd?
In X, as non-root:
open a term (call it term1) open another term (term2) type "tty" in term2, not your tty number/string in term1: type "write <your-login> <tty-string-from-above>"
replace your-login with the output of "who" if you don't know who you are logged in as
please try both /dev/pts/42 and pts/42 format for the tty part of write
example: write trevor pts/42
When I run this I get: write: trevor is not logged in on pts/42
Even though I clearly am. This used to work perfectly up until last year (I think), and I think systemd changed something (big surprise). No chatter about this anywhere that I can see. Probably the last person on earth to use write (at least on F24).
I found some other things to test that indicate that something is really amiss:
write trevor
write: trevor has messages disabled
mesg
is y
mesg y
mesg is y
write trevor
write: trevor has messages disabled
ll /dev/pts/42
crw--w---- 1 trevor tty 136, 42 Jun 28 02:48 /dev/pts/42
If someone else can confirm this bug on a non-Fedora (or a newer one) that would be great. If someone can also confirm that the above behaviour is insane, that too would be great. If anyone has some ideas on what to try next, shoot away! Then I'll file a bz. Thanks!
Works fine for me under SL6.9, SL7.3, and Raspbian/Jessie, all with the latest updates including kernel. Looks like the latest Fedora is borked. (And we all know the likely culprit, don't we...)
Gilbert
On 2017-06-28 09:33, Gilbert E. Detillieux wrote:
On 28/06/2017 2:51 AM, Trevor Cordes wrote:
Can someone else confirm this bug on another Linux system, preferably a modern one that uses systemd?
In X, as non-root:
open a term (call it term1) open another term (term2) type "tty" in term2, not your tty number/string in term1: type "write <your-login> <tty-string-from-above>"
replace your-login with the output of "who" if you don't know who you are logged in as
please try both /dev/pts/42 and pts/42 format for the tty part of write
example: write trevor pts/42
When I run this I get: write: trevor is not logged in on pts/42
Even though I clearly am. This used to work perfectly up until last year (I think), and I think systemd changed something (big surprise). No chatter about this anywhere that I can see. Probably the last person on earth to use write (at least on F24).
I found some other things to test that indicate that something is really amiss:
write trevor
write: trevor has messages disabled
mesg
is y
mesg y
mesg is y
write trevor
write: trevor has messages disabled
ll /dev/pts/42
crw--w---- 1 trevor tty 136, 42 Jun 28 02:48 /dev/pts/42
If someone else can confirm this bug on a non-Fedora (or a newer one) that would be great. If someone can also confirm that the above behaviour is insane, that too would be great. If anyone has some ideas on what to try next, shoot away! Then I'll file a bz. Thanks!
Works fine for me under SL6.9, SL7.3, and Raspbian/Jessie, all with the latest updates including kernel. Looks like the latest Fedora is borked. (And we all know the likely culprit, don't we...)
Gilbert
Not that I'm defending systemd in any way (perish the thought!), but I'm wondering if it might have something more basic and Unix-y behind it. Does it matter whether you have actual login shells on your ttys? I.e. does write depend on entries in /run/utmp or /var/log/wtmp? Do your ttys show up in a who listing on both the systems that work and those that don't? If not, try something else like the -ls option to xterm, or a login via ssh.
On 2017-06-28 Gilles Detillieux wrote:
Not that I'm defending systemd in any way (perish the thought!), but I'm wondering if it might have something more basic and Unix-y behind it. Does it matter whether you have actual login shells on your ttys? I.e. does write depend on entries in /run/utmp or /var/log/wtmp? Do your ttys show up in a who listing on both the systems that work and those that don't? If not, try something else like the -ls option to xterm, or a login via ssh.
Good ideas. No: my ptys don't show up in who. And I'm using gnome-terminal. So I tried your xterm -ls idea and write works fine between xterms! So it's a gnome-term or vte's fault then. I tried xterm without -ls and it still works. In fact, xterms still show up in who even without -ls.
Interesting, who doesn't show any entry for any gnome-term pts, just 1 entry for the X/dm session I assume. And gnome-term doesn't have any option for -ls (doesn't have very many options at all as they continually dumb it down).
I'll file a bz against gnome-term / vte for this as I'm pretty sure it's supposed to work. And I know it used to, last year this worked no problem. Big changes always occurring in vte so I'm not too surprised.
Thanks Detillieux brothers!
Follow-up: I made a bz for it https://bugzilla.redhat.com/show_bug.cgi?id=1466993 and was promptly informed it's an upstream WONTFIX. See: https://bugzilla.gnome.org/show_bug.cgi?id=747046
So the GNOME guys in all their wisdom decided utmp wasn't important and proceeded to rip out all the relevant code:
"pty-helper removal is a nice win: 22 files changed, 22 insertions(+), 2944 deletions(-)"
Now I see what is wrong with "the kids these days", mainly the GNOME and systemd clowns. Their idea of a great "win" is to rip out 3000 lines of code that destroys agreed upon conventions? I wonder how many other things broke because of their destructive fervor.
So write to a pts is broken. But it's also broken to just "write trevor", unless you have at least one xterm open, then the xterm gets the message but not the g-t's.
For fun I tried wall. This is even worse. With only g-t's open the wall gives no error, appears to proceed, but produces no output on ANY g-t! WTF? At least write tells you it ain't going to work. So much for admins telling their users a reboot is imminent with wall.
Fun MUUG exercise: can anyone think of other standard tools that would be broken by this? I'll test them out and add them to the bug.
Expert MUUG exercise: can anyone think of a workaround I can use to write to a specific pts without using the "write" command? I'd still like to get this to work as a script I wrote depends on it.
Bonus exercise: can anyone recommend a terminal I should use instead of g-t. Seems every year I run into another g-t "XXX deletions, nice win!" problem. Absolute requirements: must be able to CTL-click (or something-click) urls to open them in a browser; must have either sane or user-configurable double-click-select characters; configurable long scrollback buffer. Gravy g-t has I can live without if I must: rewraps long lines when window is resized. Probably more things I can't immediately think of but use every day :-)
Oh ya, and xterm is very weird (unforgiving) in where you have to click to drag to select text, compared to g-t at least. But that I could live with, I guess.
Thanks!
KDE's terminal is more than a bit overweight as terminal code goes, but AFAIK hasn't succumbed to GNOME's we'll-tell-you-what-you-want Apple-like mentality. Yet, anyway. I'm pretty sure all the major terminals (gnome-terminal excepted, obviously) haven't reached that state. So that leaves you with, off the top of my head, Xterm Konsole Xfceterm Lxterm
Surely *one* of them will meet your needs? And if not those, "dnf search terminal" should return about a hundred more.
-Adam
-----Original Message----- From: Roundtable [mailto:roundtable-bounces@muug.ca] On Behalf Of Trevor Cordes Sent: July 2, 2017 18:01 To: Gilles Detillieux grdetil@scrc.umanitoba.ca Cc: Continuation of Round Table discussion roundtable@muug.ca Subject: Re: [RndTbl] Linux "write"
Follow-up: I made a bz for it https://bugzilla.redhat.com/show_bug.cgi?id=1466993 and was promptly informed it's an upstream WONTFIX. See: https://bugzilla.gnome.org/show_bug.cgi?id=747046
So the GNOME guys in all their wisdom decided utmp wasn't important and proceeded to rip out all the relevant code:
"pty-helper removal is a nice win: 22 files changed, 22 insertions(+), 2944 deletions(-)"
Now I see what is wrong with "the kids these days", mainly the GNOME and systemd clowns. Their idea of a great "win" is to rip out 3000 lines of code that destroys agreed upon conventions? I wonder how many other things broke because of their destructive fervor.
So write to a pts is broken. But it's also broken to just "write trevor", unless you have at least one xterm open, then the xterm gets the message but not the g-t's.
For fun I tried wall. This is even worse. With only g-t's open the wall gives no error, appears to proceed, but produces no output on ANY g-t! WTF? At least write tells you it ain't going to work. So much for admins telling their users a reboot is imminent with wall.
Fun MUUG exercise: can anyone think of other standard tools that would be broken by this? I'll test them out and add them to the bug.
Expert MUUG exercise: can anyone think of a workaround I can use to write to a specific pts without using the "write" command? I'd still like to get this to work as a script I wrote depends on it.
Bonus exercise: can anyone recommend a terminal I should use instead of g-t. Seems every year I run into another g-t "XXX deletions, nice win!" problem. Absolute requirements: must be able to CTL-click (or something-click) urls to open them in a browser; must have either sane or user-configurable double-click-select characters; configurable long scrollback buffer. Gravy g-t has I can live without if I must: rewraps long lines when window is resized. Probably more things I can't immediately think of but use every day :-)
Oh ya, and xterm is very weird (unforgiving) in where you have to click to drag to select text, compared to g-t at least. But that I could live with, I guess.
Thanks! _______________________________________________ Roundtable mailing list Roundtable@muug.ca https://muug.ca/mailman/listinfo/roundtable
On 2017-07-02 Adam Thompson wrote:
Surely *one* of them will meet your needs? And if not those, "dnf search terminal" should return about a hundred more.
I guess I should have reworded my question to: what's your favorite terminal, and can you quickly check if it does my 3 must-have requirements. Ya, a bit lazy on my part, but also good to see what the MUUG old hands have decided/perfected over the years.
I've tried a few other terms over the years, but they always lack one of my must-haves or have some major flaw. g-t is actually *very* nice, if they would just stop deleting code (the cause of every grievance I've ever filed)!!!
This, from the gnome bz I referenced, sums out their attitude: "decide which ones are still relevant on _modern systems_, and remove the rest".
Sorry, I have to agree with them. Your use case is... pretty much obsolete, at least in my opinion.
I can honestly say that I haven't even cared, never mind *needed* to, use write(1) to reach a locally-logged-in user running a local X terminal since 1993, when I left the UofM at a time when people still did stuff like run X apps remotely from multiple systems. This is a real world example of https://xkcd.com/1172/ from my perspective.
I use write *very* occasionally on systems where I know everyone has SSH'd in. Maybe once a year. They could deprecate write(1) and wall(8) altogether and I wouldn't shed many tears.
Having said that, yes getting working code deleted out from under you is really, really annoying. Especially from a group that navel-gazes and doesn't attempt to find out usage levels first.
OpenBSD, for example, deletes a *ton* of legacy code on a regular basis. But if you follow the mailing lists, you always have a say, your voice gets heard. Maybe ignored, but heard :-). Several times in my memory, they've refactored code instead of deleting it when 2 or 3 people politely objected.
Anyway, I don't have a neat solution wrapped up for you, sorry. I finally gave up on Linux as a desktop last year, and I was using gnome terminal to the bitter end (and not caring whether it wrote to utmp/wtmp or not <grin>).
-Adam
On July 3, 2017 1:44:16 AM CDT, Trevor Cordes trevor@tecnopolis.ca wrote:
On 2017-07-02 Adam Thompson wrote:
Surely *one* of them will meet your needs? And if not those, "dnf search terminal" should return about a hundred more.
I guess I should have reworded my question to: what's your favorite terminal, and can you quickly check if it does my 3 must-have requirements. Ya, a bit lazy on my part, but also good to see what the MUUG old hands have decided/perfected over the years.
I've tried a few other terms over the years, but they always lack one of my must-haves or have some major flaw. g-t is actually *very* nice, if they would just stop deleting code (the cause of every grievance I've ever filed)!!!
This, from the gnome bz I referenced, sums out their attitude: "decide which ones are still relevant on _modern systems_, and remove the rest".
On 2017-07-03 Adam Thompson wrote:
Sorry, I have to agree with them. Your use case is... pretty much obsolete, at least in my opinion.
Getting philosophical: one of the virtues of *NIX I always extol to outsiders and insiders alike is how *NIX always builds on the past, and rarely (until recently) destroys it. This was its strength. It didn't break %#!@. It didn't revamp itself into something new we hate every 5 years (ehem, Micro$oft). It just kept adding features.
I would say that was true from when I started on *NIX in 1992 through to about 2010. During that heyday, almost nothing I cared about or used ever broke. Since then it's changed drastically. I used to look forward to the new RH (later Fedora) version release, now I dread every latest Fedora, because I know it will break 2-4 things that will cost me 2-4 days (or more, sometimes weeks) debugging or working around.
Somewhere along the way the dev mindset changed from respecting the past to actively destroying it for destruction's sake. In 1992 I respected what the guys in 1970 did, so why can't the 2017 devs respect what we did in 1995?
If you change this aspect of *NIX, then you knock down one of its key pillars. It becomes another Windows where you throw away your mastery and tools every 5-10 years; never really getting ahead, just keeping up.
real world example of https://xkcd.com/1172/ from my perspective.
Ha, well, not quite... wall and write and utmp are documented things that are supposed to work as intended (and have for, 40 years?). But good cartoon anyhow :-)
Anyway, I don't have a neat solution wrapped up for you, sorry. I finally gave up on Linux as a desktop last year, and I was using gnome terminal to the bitter end (and not caring whether it wrote to
Shame, as I think Linux as a desktop is finally "here". When I can convert my wife, mom and dad to Linux without any pushback or non-stop support calls, you know Linux has arrived. In fact, I deal with far less "support" with them on Linux than I ever did with Windows! And I can fix it all with ssh instead of vnc. (A funny aside: I tried some on stock Fedora GNOME 3/shell and they couldn't figure anything out; but switching to XFCE solved that problem. Heck, I can barely figure out GNOME 3, so I'm not sure who their target market is.)
Personally, I can't see how anyone could use Windows for serious multitasking desktop work these days... but that's a whole other discussion.
Yeah, I agree - mostly.
I also agree with (again) the OpenBSD project where they feel that by carefully! removing unused or unsafe code, they're improving the average quality of what's left.
You're spot-on about the timelines though. What you're describing is, I think, not so much "the September that never ended", but "the CADT event that never ended". (https://www.jwz.org/doc/cadt.html)
Not sure why, but it sucks.
-Adam
On July 3, 2017 2:29:42 AM CDT, Trevor Cordes trevor@tecnopolis.ca wrote:
On 2017-07-03 Adam Thompson wrote:
Sorry, I have to agree with them. Your use case is... pretty much obsolete, at least in my opinion.
Getting philosophical: one of the virtues of *NIX I always extol to outsiders and insiders alike is how *NIX always builds on the past, and rarely (until recently) destroys it. This was its strength. It didn't break %#!@. It didn't revamp itself into something new we hate every 5 years (ehem, Micro$oft). It just kept adding features.
I would say that was true from when I started on *NIX in 1992 through to about 2010. During that heyday, almost nothing I cared about or used ever broke. Since then it's changed drastically. I used to look forward to the new RH (later Fedora) version release, now I dread every latest Fedora, because I know it will break 2-4 things that will cost me 2-4 days (or more, sometimes weeks) debugging or working around.
Somewhere along the way the dev mindset changed from respecting the past to actively destroying it for destruction's sake. In 1992 I respected what the guys in 1970 did, so why can't the 2017 devs respect what we did in 1995?
If you change this aspect of *NIX, then you knock down one of its key pillars. It becomes another Windows where you throw away your mastery and tools every 5-10 years; never really getting ahead, just keeping up.
real world example of https://xkcd.com/1172/ from my perspective.
Ha, well, not quite... wall and write and utmp are documented things that are supposed to work as intended (and have for, 40 years?). But good cartoon anyhow :-)
Anyway, I don't have a neat solution wrapped up for you, sorry. I finally gave up on Linux as a desktop last year, and I was using gnome terminal to the bitter end (and not caring whether it wrote to
Shame, as I think Linux as a desktop is finally "here". When I can convert my wife, mom and dad to Linux without any pushback or non-stop support calls, you know Linux has arrived. In fact, I deal with far less "support" with them on Linux than I ever did with Windows! And I can fix it all with ssh instead of vnc. (A funny aside: I tried some on stock Fedora GNOME 3/shell and they couldn't figure anything out; but switching to XFCE solved that problem. Heck, I can barely figure out GNOME 3, so I'm not sure who their target market is.)
Personally, I can't see how anyone could use Windows for serious multitasking desktop work these days... but that's a whole other discussion.
On 03/07/2017 2:29 AM, Trevor Cordes wrote:
On 2017-07-03 Adam Thompson wrote:
Sorry, I have to agree with them. Your use case is... pretty much obsolete, at least in my opinion.
Getting philosophical: one of the virtues of *NIX I always extol to outsiders and insiders alike is how *NIX always builds on the past, and rarely (until recently) destroys it. This was its strength. It didn't break %#!@. It didn't revamp itself into something new we hate every 5 years (ehem, Micro$oft). It just kept adding features.
I would say that was true from when I started on *NIX in 1992 through to about 2010. During that heyday, almost nothing I cared about or used ever broke.
Ah, but that was just after the Great UNIX Standards Wars of the '80's... In the early years of UNIX, things were a bit more fluid and new versions did introduce incompatibilities. (And the original creators of UNIX moved on to other, rather different and incompatible OS projects, like Plan 9.)
What the competing standards did accomplish is (at least for a while) an awareness of the importance of software portability and trying to nail down a minimal set of compatibility standards (like POSIX, at least, if you didn't want to commit to either a SYSV- or BSD-compatible system).
Then Linux came along, and (at least in the early years) took the attitude that features from any of the various UNIX flavours that were useful were all up for grabs, and they took the best and left the rest. (Or, arguably, the other way around, especially if you're a hard-core BSD fan.) As long as a lot of the Linux developers had one foot in another camp, it kept things in the API's _reasonably_ compatible with other UNIX flavours.
But that was in the past...
Since then it's changed drastically. I used to look forward to the new RH (later Fedora) version release, now I dread every latest Fedora, because I know it will break 2-4 things that will cost me 2-4 days (or more, sometimes weeks) debugging or working around.
Somewhere along the way the dev mindset changed from respecting the past to actively destroying it for destruction's sake. In 1992 I respected what the guys in 1970 did, so why can't the 2017 devs respect what we did in 1995?
If you change this aspect of *NIX, then you knock down one of its key pillars. It becomes another Windows where you throw away your mastery and tools every 5-10 years; never really getting ahead, just keeping up.
I think a lot of the Linux development lost its way years ago, when they focused far too much on the Desktop (in a vain bid for "world domination") and ignored the more established server market which had been their bread and butter. The longer they do that, the more they'll continue to alienate the server market, who'll move to other platforms (like *BSD). And in the end, they're not going to win the desktop market, but will always be trying to catch up to the big boys.
real world example of https://xkcd.com/1172/ from my perspective.
Ha, well, not quite... wall and write and utmp are documented things that are supposed to work as intended (and have for, 40 years?). But good cartoon anyhow :-)
As far as write(1) and other chat systems go, this is perhaps more to the point...
As a very early user of write(1), I had already grown to hate it long ago, for social/usage reasons more than technical issues, so I don't particularly care if it goes. And it can take the rest of the proprietary chat systems along with it! (Never had much use for any of them, and hate the fact that they're all busy reinventing the same broken wheel in their own incompatible way, rather than working toward a unifying standard that is actually useful.)
Call me old-fashioned, but gimme an IMAP/SMTP-based e-mail client over the above, any day! Even the very limited (and limiting) iOS Mail app is more versatile and useful than any chat app I've ever had to struggle with.
Anyway, I don't have a neat solution wrapped up for you, sorry. I finally gave up on Linux as a desktop last year, and I was using gnome terminal to the bitter end (and not caring whether it wrote to
Shame, as I think Linux as a desktop is finally "here". When I can convert my wife, mom and dad to Linux without any pushback or non-stop support calls, you know Linux has arrived. In fact, I deal with far less "support" with them on Linux than I ever did with Windows! And I can fix it all with ssh instead of vnc. (A funny aside: I tried some on stock Fedora GNOME 3/shell and they couldn't figure anything out; but switching to XFCE solved that problem. Heck, I can barely figure out GNOME 3, so I'm not sure who their target market is.)
See my desktop/world-domination rant above. :)
Besides, Gnome 3 is to GUI's as "newspeak" is to language. (Read "1984" if you haven't already.)
Personally, I can't see how anyone could use Windows for serious multitasking desktop work these days... but that's a whole other discussion.
As far as using Windows, I'm going to stick with Win7 for as long as I can. Really don't like what they've done with the GUI in a lame attempt at being more tablet-friendly. Not particularly fond of the macOS development direction either, but it's not quite as ugly and broken as Windows 10.
On 2017-07-05 Gilbert E. Detillieux wrote:
As far as write(1) and other chat systems go, this is perhaps more to the point...
Ha! Love the two "walls".
As a very early user of write(1), I had already grown to hate it long
Ah, but how do you feel about wall(1)? Doesn't that still have a bit more use, or does no one care about wall anymore either... and you agree with their snubbing of who and u/wtmp?
At a conceptual level, I'm wondering whose is the problem of write not working with g-t. If g-t is literally the only terminal in the history of mankind that doesn't work properly with write, and g-t says NOTABUG/WONTFIX, then does the onus fall on the write team to, say, document in the man page that write doesn't work with g-t? This "limbo" kind of irks me in a strange way.
ago, for social/usage reasons more than technical issues, so I don't particularly care if it goes. And it can take the rest of the
OK, now I reveal the reason I need "write" to work, as perhaps someone can think of an alternate way to achieve the same ends. I use write in a script that indicates to me when I already have a text file open in another terminal window. The window I'm in says the file is open in another window, and my script writes a ton of *'s to the other window. Then I can rapidly spot which window has the open file, hit ^L and proceed from there.
So I'm not using write for any sort of communication with others, it's to aid me visually. (I have 16 workspaces and 100+ windows across 2 very high-pixel-count LCDs, and while I remember most of everything positionally, there's the odd time I forget something. No, a potential solution is NOT to just use less ws/windows!)
Could I just open(2) & write(2) to some file representing the pts? That would have the same effect and mitigate the need for write(1).
Is there something I could do in my wm (sawfish) to instantly switch to the ws and focus the window with the specific pts? That would be ideal!
Some other way? At least we still have the beauty of *NIX in all likelihood giving me several workarounds...
On 06/07/2017 2:12 AM, Trevor Cordes wrote:
On 2017-07-05 Gilbert E. Detillieux wrote:
As far as write(1) and other chat systems go, this is perhaps more to the point...
Ha! Love the two "walls".
As a very early user of write(1), I had already grown to hate it long
Ah, but how do you feel about wall(1)? Doesn't that still have a bit more use, or does no one care about wall anymore either... and you agree with their snubbing of who and u/wtmp?
I think about the only time I use wall(1) is in anticipation of a system shutdown. Other than that, it's more of an annoyance than anything, especially when managing systems used by immature students.
I don't think I've agreed with anything the Gnome team has done in many years now. I've just stopped caring, and avoid using Gnome-based apps, for the most part.
At a conceptual level, I'm wondering whose is the problem of write not working with g-t. If g-t is literally the only terminal in the history of mankind that doesn't work properly with write, and g-t says NOTABUG/WONTFIX, then does the onus fall on the write team to, say, document in the man page that write doesn't work with g-t? This "limbo" kind of irks me in a strange way.
The onus doesn't fall on the maintainers of write or any other low-level UNIX tools to try and second-guess something being done at a GUI-level. That's the mistake made by the systemd crowd, and maintainers of other such monolithic beasts. The UNIX way would be to keep those decoupled and modular, as much as possible. The lower layers just need to provide the primitives that make the higher layers workable; apart from that, they should try to stay out of each other's way.
If the Gnome people choose to break UNIX functionality yet again, in their attempt to be something else, that's their business. They'll just further alienate any serious UNIX users with each such step.
There are alternatives. Maybe it's time to just ditch Gnome.
ago, for social/usage reasons more than technical issues, so I don't particularly care if it goes. And it can take the rest of the
OK, now I reveal the reason I need "write" to work, as perhaps someone can think of an alternate way to achieve the same ends. I use write in a script that indicates to me when I already have a text file open in another terminal window. The window I'm in says the file is open in another window, and my script writes a ton of *'s to the other window. Then I can rapidly spot which window has the open file, hit ^L and proceed from there. > So I'm not using write for any sort of communication with others, it's to aid me visually. (I have 16 workspaces and 100+ windows across 2 very high-pixel-count LCDs, and while I remember most of everything positionally, there's the odd time I forget something. No, a potential solution is NOT to just use less ws/windows!)
Could I just open(2) & write(2) to some file representing the pts? That would have the same effect and mitigate the need for write(1).
Seems this could be done with a combination of lsof to find the tty associated with processes that have the files open, then just writing directly to the tty (e.g. using cat, or some other such utility, or even right in a perl script, say).
The whole point of write was to make it easier to send the message to the tty(s) of a particular user, with a nice identifying banner line, rather than just doing low-level writes directly to the tty.
Is there something I could do in my wm (sawfish) to instantly switch to the ws and focus the window with the specific pts? That would be ideal!
Possibly, depending on the wm. (Likely not possible in Gnome...)
Can't help you there, though. Last time I did any serious customization of a wm setup was with twm in the early '90's. And I've never worked with them at the API level.
Some other way? At least we still have the beauty of *NIX in all likelihood giving me several workarounds...
And the UNIX "KISS" philosophy... If this is just for your own internal use, I wouldn't spend too much effort on making it pretty and user friendly.
On 2017-07-06 Gilbert E. Detillieux wrote:
The onus doesn't fall on the maintainers of write or any other low-level UNIX tools to try and second-guess something being done at a GUI-level. That's the mistake made by the systemd crowd, and
True. But it seemed the level of cooperation/sanity used to be much greater. 15 years ago one wouldn't just say "delete all the utmp/pts/write code, who cares". Oh well.
There are alternatives. Maybe it's time to just ditch Gnome.
I'm already *not* using Gnome (haven't since Gnome2 was ditched, exactly 15 years ago!), I'm using XFCE and sawfish and very, very happy with it. It's only gnome-terminal I'm using, as it used to be very nice and cutting edge, and prior to about 5 years ago just added features, rather than ripping them out (as Adam said).
Could I just open(2) & write(2) to some file representing the pts? That would have the same effect and mitigate the need for write(1).
Seems this could be done with a combination of lsof to find the tty associated with processes that have the files open, then just writing directly to the tty (e.g. using cat, or some other such utility, or even right in a perl script, say).
I tried it out and directly writing does work. Don't know why I didn't try that sooner... thought perhaps there was some sort of protocol on that special file. I forgot "everything's a file". So now I have my script working again after changing 1 line and I can ignore g-t's shenanigans for another few months until they remove some other feature I use... I swear one of these days I'll actually switch :-) Honest!
P.S. instead of using lsof my script just looks at the env vars of the ps that is using my editor on that file; that provides the pts number.
Possibly, depending on the wm. (Likely not possible in Gnome...)
Can't help you there, though. Last time I did any serious customization of a wm setup was with twm in the early '90's. And I've never worked with them at the API level.
This would be a fun thing to tackle, I'll add it to my fun-thing-to-tackle (but-probably-never-will-get-around-to) list. I'm pretty sure sawfish with its can-do-everything-in-lisp can do it somehow...
Thanks all!