I do not know if this list is private or public, but if so I apologize for
any inconvenience.
Working with tmux for about 2 years, I have encountered multiple times a
weird (in my opinion) behaviour with utmp records.
Every time a window or a pane is created, the output of 'who' command doe
not show any change in utmp records in the system.
Instance I: This problem came up last year, when I was trying from a C
program to get the name of the user logged on the conrtolling terminal. At
this point a similar test I just wrote seems to behave correctly: when I
run the compiled program for 'test.c' I get the expected output.
However, when I run 'who' in the same terminal I get that only the record
for the terminal that spawned the tmux client is active. 'who -d' shows
correctly the controlling terminals for all windows and panes spawned.
Instance II: I was trying to send a message with write(1) to a pane, but
the utmp record did not show up when running 'who'. Finding it from the
output of 'who -a', deducing the username, and 'write(1)'ing to it was
successful.
Question I: Is that the intended behaviour of windows and panes? Or is it a
misconfiguration or bug of only my system?
Question II: If that is indeed the intended behaviour, why was it chosen?
If not, shouldn't attaching to a session or creating windows and panes do
something for the utmp records?
Thank you for your attention.
/*
* .: Testing ttyname() and getlogin() under tmux and outside it. That is intended to check utmp records.
*
* ?: ????????????????????????????
* @: 2013-07-25T09:10:29 EEST
*
*/
#include <stdio.h>
#include <unistd.h>
int main (void) {
fprintf(stderr, "Controlling tty is %s\n", ttyname(fileno(stdin)));
fprintf(stderr, "Login name is %s\n", getlogin());
return 0;
}
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users