[gnome-builder] plugins/terminal: don't reuse PTY for run output



commit 8a5d527754dcb43f702f3fca235a672e55cea529
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jul 14 15:54:44 2022 -0700

    plugins/terminal: don't reuse PTY for run output
    
    It might get closed and we can no longer interact with it. Just create a
    new one for each run.

 src/plugins/terminal/gbp-terminal-workspace-addin.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/terminal/gbp-terminal-workspace-addin.c 
b/src/plugins/terminal/gbp-terminal-workspace-addin.c
index 009e0c099..6c662ab8e 100644
--- a/src/plugins/terminal/gbp-terminal-workspace-addin.c
+++ b/src/plugins/terminal/gbp-terminal-workspace-addin.c
@@ -164,7 +164,7 @@ on_run_manager_run (GbpTerminalWorkspaceAddin *self,
   g_autoptr(GDateTime) now = NULL;
   g_autofree char *formatted = NULL;
   g_autofree char *tmp = NULL;
-  VtePty *pty;
+  g_autoptr(VtePty) pty = NULL;
 
   IDE_ENTRY;
 
@@ -173,7 +173,9 @@ on_run_manager_run (GbpTerminalWorkspaceAddin *self,
   g_assert (IDE_IS_RUN_CONTEXT (run_context));
   g_assert (IDE_IS_RUN_MANAGER (run_manager));
 
-  pty = ide_terminal_page_get_pty (self->app_page);
+  pty = ide_pty_new_sync (NULL);
+
+  ide_terminal_page_set_pty (self->app_page, pty);
 
   ide_run_context_push (run_context, NULL, NULL, NULL);
   ide_run_context_set_pty (run_context, pty);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]