mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-21 23:53:21 +01:00
Send uname
This commit is contained in:
parent
86ec8d1ad6
commit
9fc6e96444
@ -1,3 +1,4 @@
|
||||
#include <sys/utsname.h>
|
||||
#include "tmate.h"
|
||||
#include "tmate-protocol.h"
|
||||
#include "window-copy.h"
|
||||
@ -12,6 +13,23 @@ void tmate_write_header(void)
|
||||
pack(string, VERSION);
|
||||
}
|
||||
|
||||
void tmate_write_uname(void)
|
||||
{
|
||||
struct utsname name;
|
||||
if (uname(&name) < 0) {
|
||||
tmate_debug("uname() failed");
|
||||
return;
|
||||
}
|
||||
|
||||
pack(array, 6);
|
||||
pack(int, TMATE_OUT_UNAME);
|
||||
pack(string, name.sysname);
|
||||
pack(string, name.nodename);
|
||||
pack(string, name.release);
|
||||
pack(string, name.version);
|
||||
pack(string, name.machine);
|
||||
}
|
||||
|
||||
void tmate_write_ready(void)
|
||||
{
|
||||
pack(array, 1);
|
||||
@ -464,6 +482,7 @@ void tmate_send_reconnection_state(struct tmate_session *session)
|
||||
tmate_send_reconnection_data(session);
|
||||
replay_saved_cmd(session);
|
||||
/* TODO send all option variables */
|
||||
tmate_write_uname();
|
||||
tmate_write_ready();
|
||||
|
||||
tmate_sync_layout();
|
||||
|
@ -56,6 +56,7 @@ enum tmate_daemon_out_msg_types {
|
||||
TMATE_OUT_RECONNECT,
|
||||
TMATE_OUT_SNAPSHOT,
|
||||
TMATE_OUT_EXEC_CMD,
|
||||
TMATE_OUT_UNAME,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -77,6 +78,8 @@ enum tmate_daemon_out_msg_types {
|
||||
[TMATE_OUT_RECONNECT, string: reconnection_data]
|
||||
[TMATE_OUT_SNAPSHOT, ...]
|
||||
[TMATE_OUT_EXEC_CMD, string: cmd_name, ...string: args]
|
||||
[TMATE_OUT_UNAME, string: name.sysname, string: name.nodename,
|
||||
string: name.release, string: name.version, string: name.machine]
|
||||
*/
|
||||
|
||||
enum tmate_daemon_in_msg_types {
|
||||
|
@ -200,6 +200,7 @@ void tmate_session_start(void)
|
||||
}
|
||||
|
||||
send_authorized_keys();
|
||||
tmate_write_uname();
|
||||
tmate_write_ready();
|
||||
lookup_and_connect();
|
||||
}
|
||||
|
1
tmate.h
1
tmate.h
@ -79,6 +79,7 @@ extern void unpack_array(struct tmate_unpacker *uk, struct tmate_unpacker *neste
|
||||
struct tmate_session;
|
||||
|
||||
extern void tmate_write_header(void);
|
||||
extern void tmate_write_uname(void);
|
||||
extern void tmate_write_ready(void);
|
||||
extern void tmate_sync_layout(void);
|
||||
extern void tmate_pty_data(struct window_pane *wp, const char *buf, size_t len);
|
||||
|
Loading…
Reference in New Issue
Block a user