diff options
author | 2023-10-03 22:09:45 +0600 | |
---|---|---|
committer | 2023-10-03 22:09:45 +0600 | |
commit | ac24c495d06522303652232a6ede276c2d630f9e (patch) | |
tree | 0383831c5cdc85896fc8cf414b6ecab3bd85f452 /src/window.vala | |
parent | 047a1cf0fc63d140afc83a15d69004744e68bf3f (diff) | |
download | jadupc-remote-support-console-ac24c495d06522303652232a6ede276c2d630f9e.tar.gz jadupc-remote-support-console-ac24c495d06522303652232a6ede276c2d630f9e.zip |
Backport to debian
Signed-off-by: Mubashshir <ahm@jadupc.com>
Diffstat (limited to 'src/window.vala')
-rw-r--r-- | src/window.vala | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/window.vala b/src/window.vala index 5cdfc65..640e287 100644 --- a/src/window.vala +++ b/src/window.vala @@ -47,6 +47,11 @@ namespace JadupcSupport infobar.response.connect(() => infobar.set_revealed(false)); + tmate.network_error.connect((message) => { + show_in_infobar(ERROR, message); + }); + + tmate.stopped.connect(reset_window); tmate.address.connect((stype, addr) => { if(Tmate.SessionType.SSH in stype) on_session_connect(addr); @@ -63,6 +68,7 @@ namespace JadupcSupport configFactory.delete(config); tmate.disconnect(session_handler); }); + tmate.start(config); }); @@ -87,7 +93,11 @@ namespace JadupcSupport private void reset_window() { session.label = _("Disconnected..."); - Timeout.add_once(view.transition_duration, () => terminal.reset(true, true)); + Timeout.add(view.transition_duration, () => { + terminal.reset(true, true); + return false; + }); + view.visible_child_name = "session"; } @@ -100,14 +110,12 @@ namespace JadupcSupport private void on_session_connect(string url) { + terminal.spawn_async(Vte.PtyFlags.DEFAULT, "~", {"tmate", "-S", tmate.socket, "attach"}, {@"PATH=$(Config.SECURE_PATH)"}, + SpawnFlags.SEARCH_PATH_FROM_ENVP, null, -1, null, spawn_async_cb); + session.label = @"<a href=\"ssh://$url\">ssh://$url</a>"; view.visible_child_name = "terminal"; terminal.has_focus = true; - debug(url); - debug(tmate.socket); - - terminal.spawn_async(Vte.PtyFlags.DEFAULT, "~", {"tmate", "-S", tmate.socket, "attach"}, {@"PATH=$(Config.SECURE_PATH)"}, - SpawnFlags.SEARCH_PATH_FROM_ENVP, null, -1, null, spawn_async_cb); } } } |