1

Usually a write command (reference: write) will cause the receiver to see

Message from yourname@yourhost on yourtty at hh:mm ...

I don't see that... Any idea?


In my Windows 10, I have a virtual machine as Linux Mint 18.2. I create two accounts: paul and mary. I login as paul in VM. I open a GNOME terminal. I open another terminal but login as mary (using sudo login mary).

In paul's terminal, I write mary. A message at mary's terminal would appear:

Message from paul@monte-VirtualBox on pts/1 at 20:01 ...

In mary's terminal, I write paul. First I see:

write: write: you have write permission turned off.

I fix this by mesg y. I try write paul again. However at paul's terminal, I don't see that Message from! After I type a message and press Control D, paul's terminal does not show the message I just typed. Why?

I do a who -aH and get:

NAME       LINE         TIME             IDLE          PID COMMENT  EXIT
           system boot  2018-05-04 20:39
           run-level 5  2018-05-04 20:39
LOGIN      tty1         2018-05-04 20:39              1124 id=tty1
paul     + tty7         2018-05-04 20:39 00:05        1439 (:0)
mary     + pts/0        2018-05-04 14:41   .          2231    

Note the message in mary's terminal says paul is at pts/1 while who says paul is at tty7.


I then install xterm. Open it up and of course, that is paul in xterm.

  1. At paul's gnome terminal, I write paul pts/2, paul's xterm shows:

    Message from paul@monte-VirtualBox on pts/1 at 20:49 ...

  2. At paul'x xterm, I write paul tty1 (or write paul pts/1), I get:

    write: paul is not logged in on tty1

    I type write paul tty7, no message from appear in paul's terminal. Message I type in xterm does not appear in paul's terminal.

  3. At mary's terminal, I `write paul pts/2', paul's xterm shows:

    Message from mary@monte-VirtualBox on pts/0 at 20:50 ...

1 Answer 1

1

First of all, tty7 is not GNOME Terminal. Names starting with tty represent some kind of actual device – tty7 is the seventh virtual console (i.e. the screen you get at Ctrl+Alt+F7).

So the utmp entry you see doesn't represent any terminal app; it represents the Xorg session as a whole. (utmp entries aren't just for interactive shells – they can be added for X11 logins, FTP sessions, and so on.)

Where's the entry for your GNOME Terminal window? There isn't any, because utmp support was removed from the vte terminal library in version 0.41.90. (utmp entries don't show up automatically – they are added and removed manually by the terminal emulator, or by sshd, or by the login command...)

Where do your messages go on tty7? They're hidden "behind" the graphical Xorg interface. (I'm not sure if there's any way to see them. If you log out, then go to the "empty" tty7 manually, you might find the lost messages there.)

How to send messages to GNOME Terminal now? Unfortunately, although you can find the correct terminal name (by running tty), you cannot use it with write – since there's no utmp entry, write thinks the user isn't logged in.

1
  • Thanks for the answer, although I am not happy that there is no way to see back the message on tty7. Commented May 14, 2018 at 1:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .