w
does not show terminal sessions. The login database, that the w
program reports on, is not a terminal database. (Formally, it is a user accounting database, but the Single Unix Specification is incomplete on this point.)
If it were a terminal database, it would record all of the pseudo terminals that programs use, from the likes of NeoVIM, emacs, tmux
, screen
, ptybandage
, ptyrun
, and even script
. But it does not, and it is not.
(One can make a similar argument, that needs a slightly greater knowledge of history, about it not recording "call out" terminal usage and the likes of BBS, FidoNet, and UUCP terminal sessions.)
As a login database, it records login sessions, both textual and graphical. The libvte people make the argument that writing to this database is within the purview of the login subsystems, graphical and textual, not within the purview of a terminal emulator that runs within login sessions. This is a fair point, bolstered by the fact that it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database.
As such, you shouldn't expect every terminal emulator session to show up as a login session in the login database — or indeed any terminal emulator sessions. Even terminal emulators that are invoking login shells are not doing any actual logging on to the system, and are acting entirely within an already-logged-in session. Terminal emulator writers tried to make the login database record terminal emulator sessions, but the effort has led to a number of problems, long-since recognized.
Conversely, you should expect to see a single record for your GUI login session. (Although, as explained in an article in further reading, in practice this is rather a mess.)
Further reading
$-
contains anl
in the shell).$-
. I am getting errorhimBH command not found
and forecho $-
it says himBH