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();