|
|
|
@ -160,6 +160,7 @@ typedef struct {
|
|
|
|
|
} STREscape;
|
|
|
|
|
|
|
|
|
|
static void execsh(char *, char **);
|
|
|
|
|
static char *getcwd_by_pid(pid_t pid);
|
|
|
|
|
static void stty(char **);
|
|
|
|
|
static void sigchld(int);
|
|
|
|
|
static void ttywriteraw(const char *, size_t);
|
|
|
|
@ -1057,6 +1058,20 @@ tnew(int col, int row)
|
|
|
|
|
treset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
newterm(const Arg* a)
|
|
|
|
|
{
|
|
|
|
|
switch (fork()) {
|
|
|
|
|
case -1:
|
|
|
|
|
die("fork failed: %s\n", strerror(errno));
|
|
|
|
|
break;
|
|
|
|
|
case 0:
|
|
|
|
|
chdir(getcwd_by_pid(pid));
|
|
|
|
|
execlp("st", "./st", NULL);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
tswapscreen(void)
|
|
|
|
|
{
|
|
|
|
@ -1101,6 +1116,12 @@ kscrollup(const Arg* a)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *getcwd_by_pid(pid_t pid) {
|
|
|
|
|
char buf[32];
|
|
|
|
|
snprintf(buf, sizeof buf, "/proc/%d/cwd", pid);
|
|
|
|
|
return realpath(buf, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
tscrolldown(int orig, int n, int copyhist)
|
|
|
|
|
{
|
|
|
|
|