From 2b146115446ca0477d2c3d7155f07f22fdb9c265 Mon Sep 17 00:00:00 2001 From: Nicolas Viennot Date: Thu, 7 Nov 2019 13:31:28 -0500 Subject: [PATCH] Polish session messages --- session.c | 4 ++-- tmate-session.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/session.c b/session.c index 07ca9acc8..879eb657b 100644 --- a/session.c +++ b/session.c @@ -222,7 +222,7 @@ static void maybe_restart_session(void) next_session_id = 0; run_initial_client_cmd(); - tmate_info("Shell exited. Shell restarted"); + tmate_info("Session shell restarted"); struct session *s; s = RB_MIN(sessions, &sessions); @@ -233,7 +233,7 @@ static void maybe_restart_session(void) wp = s->curw->window->active; window_pane_set_mode(wp, &window_copy_mode); window_copy_init_for_output(wp); - window_copy_add(wp, "%s", "Shell exited. Shell restarted."); + window_copy_add(wp, "%s", "Session shell restarted"); window_copy_add(wp, "%s", "Note: press the following sequence to disconnect from SSH: ~."); } diff --git a/tmate-session.c b/tmate-session.c index f3a904bd1..1863f78c8 100644 --- a/tmate-session.c +++ b/tmate-session.c @@ -190,7 +190,10 @@ void tmate_session_start(void) * - While we are parsing the config file, we need to be able to * serialize it, and so we need a worker encoder. */ - if (!tmate_foreground) { + if (tmate_foreground) { + tmate_set_val("foreground", "true"); + tmate_info("To connect to the session locally, run: tmate -S %s attach", socket_path); + } else { cfg_add_cause("%s", "To see these messages again, run: tmate show-messages"); cfg_add_cause("%s", "Press to dismiss"); cfg_add_cause("%s", "-----------------------------------------------------");