From 5a76a2c142ef0d79e2fb944a76a213921992a035 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 16 Nov 2010 18:46:08 +0000 Subject: [PATCH] Added ActiveProcessGroup() getter to Shell and TermView. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39451 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/Shell.cpp | 7 +++++++ src/apps/terminal/Shell.h | 1 + src/apps/terminal/TermView.cpp | 7 +++++++ src/apps/terminal/TermView.h | 5 +++-- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/apps/terminal/Shell.cpp b/src/apps/terminal/Shell.cpp index 52250ceeac..770889e856 100644 --- a/src/apps/terminal/Shell.cpp +++ b/src/apps/terminal/Shell.cpp @@ -231,6 +231,13 @@ Shell::FD() const } +pid_t +Shell::ActiveProcessGroup() const +{ + return tcgetpgrp(fFd); +} + + bool Shell::HasActiveProcesses() const { diff --git a/src/apps/terminal/Shell.h b/src/apps/terminal/Shell.h index c82ec63b40..92661d7886 100644 --- a/src/apps/terminal/Shell.h +++ b/src/apps/terminal/Shell.h @@ -44,6 +44,7 @@ public: int FD() const; pid_t ProcessID() const { return fProcessID; } + pid_t ActiveProcessGroup() const; bool HasActiveProcesses() const; virtual status_t AttachBuffer(TerminalBuffer* buffer); diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 1b7826efcd..943ed97e15 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -628,6 +628,13 @@ TermView::~TermView() } +pid_t +TermView::ActiveProcessGroup() const +{ + return fShell != NULL ? fShell->ActiveProcessGroup() : -1; +} + + bool TermView::IsShellBusy() const { diff --git a/src/apps/terminal/TermView.h b/src/apps/terminal/TermView.h index 98993dbf11..b127000b2d 100644 --- a/src/apps/terminal/TermView.h +++ b/src/apps/terminal/TermView.h @@ -46,6 +46,7 @@ public: virtual void GetPreferredSize(float* _width, float* _height); + pid_t ActiveProcessGroup() const; bool IsShellBusy() const; const char* TerminalName() const; @@ -73,7 +74,7 @@ public: BScrollBar* ScrollBar() const { return fScrollBar; }; void SetMouseClipboard(BClipboard *); - + virtual void SetTitle(const char* title); virtual void NotifyQuit(int32 reason); @@ -95,7 +96,7 @@ public: void DisableResizeView(int32 disableCount = 1); static void AboutRequested(); - + protected: virtual void AttachedToWindow(); virtual void DetachedFromWindow();