diff options
-rw-r--r-- | src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp | 16 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-terminal/TtyProcess.h | 2 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-terminal/lumina-terminal.pro | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp b/src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp index a4550fe3..b6ef8f6d 100644 --- a/src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp +++ b/src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp @@ -291,8 +291,18 @@ QByteArray TTYProcess::CleanANSI(QByteArray raw, bool &incomplete){ pid_t TTYProcess::LaunchProcess(int& fd, char *prog, char **child_args){ //Returns: -1 for errors, positive value (file descriptor) for the master side of the TTY to watch //First open/setup a new pseudo-terminal file/device on the system (master side) - fd = posix_openpt(O_RDWR | O_NOCTTY); //open read/write - if(fd<0){ return -1; } //could not create pseudo-terminal + //fd = posix_openpt(O_RDWR | O_NOCTTY); //open read/write + pid_t PID = forkpty( &fd, 0, 0, 0); + if(PID==0){ + //Child process + int rc = execvp(prog, child_args); + //::close(fds); //no need to keep original file descriptor open any more + exit(rc); + }else{ + //Master process + return PID; + } + /*if(fd<0){ return -1; } //could not create pseudo-terminal int rc = grantpt(fd); //set permissions if(rc!=0){ return -1; } rc = unlockpt(fd); //unlock file (ready for use) @@ -325,7 +335,7 @@ pid_t TTYProcess::LaunchProcess(int& fd, char *prog, char **child_args){ rc = execvp(prog, child_args); ::close(fds); //no need to keep original file descriptor open any more exit(rc); - } + }*/ //MASTER thread (or error) return PID; } diff --git a/src-qt5/desktop-utils/lumina-terminal/TtyProcess.h b/src-qt5/desktop-utils/lumina-terminal/TtyProcess.h index f8d709a8..42684112 100644 --- a/src-qt5/desktop-utils/lumina-terminal/TtyProcess.h +++ b/src-qt5/desktop-utils/lumina-terminal/TtyProcess.h @@ -32,7 +32,7 @@ #include <sys/types.h> #include <sys/wait.h> #include <signal.h> -//#include <libutil.h> +#include <libutil.h> class TTYProcess : public QObject{ Q_OBJECT diff --git a/src-qt5/desktop-utils/lumina-terminal/lumina-terminal.pro b/src-qt5/desktop-utils/lumina-terminal/lumina-terminal.pro index 4c623087..5216372c 100644 --- a/src-qt5/desktop-utils/lumina-terminal/lumina-terminal.pro +++ b/src-qt5/desktop-utils/lumina-terminal/lumina-terminal.pro @@ -23,7 +23,7 @@ SOURCES += main.cpp \ TtyProcess.cpp -LIBS += -lncurses +LIBS += -lutil TRANSLATIONS = i18n/l-terminal_af.ts \ |