Skip to content

Commit

Permalink
remove old terminal recognition code
Browse files Browse the repository at this point in the history
  • Loading branch information
jstkdng committed Jul 15, 2023
1 parent db8916e commit cdb480a
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,24 +297,15 @@ void Terminal::open_first_pty()
struct stat stat_info;
for (const auto spid: pids) {
auto tree = util::get_process_tree_v2(spid);
//tree.pop_back();
std::ranges::reverse(tree);
for (const auto &proc: tree) {
stat(proc.pty_path.c_str(), &stat_info);
//std::cout << proc.pid << " " << proc.tty_nr << " " << stat_info.st_rdev << std::endl;
if (proc.tty_nr == stat_info.st_rdev) {
pty_fd = open(proc.pty_path.c_str(), O_NONBLOCK);
terminal_pid = proc.pid;
logger->debug("PTY = {}" , proc.pty_path.c_str());
return;
}
/*
pty_fd = open(proc.pty_path.c_str(), O_NONBLOCK);
if (pty_fd != -1) {
terminal_pid = proc.pid;
logger->debug("PTY = {}" , proc.pty_path.c_str());
return;
}*/
}
}

Expand Down

0 comments on commit cdb480a

Please sign in to comment.