[gnome-builder/wip/chergert/debugger: 31/46] runner: allow stealing the TTY previously set
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/debugger: 31/46] runner: allow stealing the TTY previously set
- Date: Sat, 25 Mar 2017 22:41:17 +0000 (UTC)
commit 919146389403c37dbf043084275f2331f461dea4
Author: Christian Hergert <chergert redhat com>
Date: Fri Mar 24 02:59:07 2017 -0700
runner: allow stealing the TTY previously set
We might need this for things like GDB so we can redirect output back to
where a plugin expects it.
libide/runner/ide-runner.c | 14 ++++++++++++++
libide/runner/ide-runner.h | 1 +
2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libide/runner/ide-runner.c b/libide/runner/ide-runner.c
index 6acf678..152cc39 100644
--- a/libide/runner/ide-runner.c
+++ b/libide/runner/ide-runner.c
@@ -358,6 +358,20 @@ ide_runner_real_get_stderr (IdeRunner *self)
return NULL;
}
+gint
+ide_runner_steal_tty (IdeRunner *self)
+{
+ IdeRunnerPrivate *priv = ide_runner_get_instance_private (self);
+ gint fd;
+
+ g_return_val_if_fail (IDE_IS_RUNNER (self), -1);
+
+ fd = priv->tty_fd;
+ priv->tty_fd = -1;
+
+ return fd;
+}
+
static void
ide_runner_real_set_tty (IdeRunner *self,
int tty_fd)
diff --git a/libide/runner/ide-runner.h b/libide/runner/ide-runner.h
index d0f7c39..abb086d 100644
--- a/libide/runner/ide-runner.h
+++ b/libide/runner/ide-runner.h
@@ -97,6 +97,7 @@ GInputStream *ide_runner_get_stderr (IdeRunner *self);
gboolean ide_runner_get_run_on_host (IdeRunner *self);
void ide_runner_set_run_on_host (IdeRunner *self,
gboolean run_on_host);
+gint ide_runner_steal_tty (IdeRunner *self);
void ide_runner_set_tty (IdeRunner *self,
int tty_fd);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]