Update NOTES, hack on 9term a little.
This commit is contained in:
parent
3765283ccf
commit
21a17ff3e9
5 changed files with 32 additions and 15 deletions
12
NOTES
12
NOTES
|
|
@ -19,18 +19,12 @@ See below.
|
||||||
|
|
||||||
* Building
|
* Building
|
||||||
|
|
||||||
To build, cd into src and run make install. This will place binaries
|
To build, cd into src and run make; mk install. This will place binaries
|
||||||
in "bin". At time of writing, the commands are sam, samterm, and mk.
|
in "bin". At time of writing, the commands are sam, samterm, rc, and mk.
|
||||||
There are a few shell scripts already included in bin -- B, Bwait,
|
There are a few shell scripts already included in bin -- B, Bwait,
|
||||||
and samsave.
|
and samsave.
|
||||||
|
|
||||||
* Make vs. Mk
|
The "make" builds mk. Mk builds the rest.
|
||||||
|
|
||||||
I'm trying to use make for everything so that it's easier to get
|
|
||||||
off the ground, but this might not work out. Working in the
|
|
||||||
intersection of BSD make and GNU make is quite restrictive.
|
|
||||||
If I'm going to start requiring a particular build utility,
|
|
||||||
it might as well be mk.
|
|
||||||
|
|
||||||
* Helping out
|
* Helping out
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ int mainpid;
|
||||||
int plumbfd;
|
int plumbfd;
|
||||||
int label(Rune*, int);
|
int label(Rune*, int);
|
||||||
char wdir[1024];
|
char wdir[1024];
|
||||||
|
char childwdir[1024];
|
||||||
void hangupnote(void*, char*);
|
void hangupnote(void*, char*);
|
||||||
|
|
||||||
char *menu2str[] = {
|
char *menu2str[] = {
|
||||||
|
|
@ -1312,11 +1313,16 @@ plumb(uint q0, uint q1)
|
||||||
char *p;
|
char *p;
|
||||||
int i, p0, n;
|
int i, p0, n;
|
||||||
char cbuf[100];
|
char cbuf[100];
|
||||||
|
char *w;
|
||||||
|
|
||||||
|
if(getchildwdir(pid, childwdir, sizeof childwdir) == 0)
|
||||||
|
w = childwdir;
|
||||||
|
else
|
||||||
|
w = wdir;
|
||||||
pm = malloc(sizeof(Plumbmsg));
|
pm = malloc(sizeof(Plumbmsg));
|
||||||
pm->src = strdup("9term");
|
pm->src = strdup("9term");
|
||||||
pm->dst = 0;
|
pm->dst = 0;
|
||||||
pm->wdir = strdup(wdir);
|
pm->wdir = strdup(w);
|
||||||
pm->type = strdup("text");
|
pm->type = strdup("text");
|
||||||
if(q1 > q0)
|
if(q1 > q0)
|
||||||
pm->attr = nil;
|
pm->attr = nil;
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ void scrdraw(void);
|
||||||
void scroll(int);
|
void scroll(int);
|
||||||
void hostproc(void *arg);
|
void hostproc(void *arg);
|
||||||
void hoststart(void);
|
void hoststart(void);
|
||||||
void pdx(int, char*, int);
|
void getchildwd(int, char*, int);
|
||||||
void plumbstart(void);
|
void plumbstart(void);
|
||||||
void plumb(uint, uint);
|
void plumb(uint, uint);
|
||||||
void plumbclick(uint*, uint*);
|
void plumbclick(uint*, uint*);
|
||||||
|
|
|
||||||
|
|
@ -1 +1,17 @@
|
||||||
#include "Linux.c"
|
#include "9term.h"
|
||||||
|
|
||||||
|
int
|
||||||
|
getchildwd(int pid, char *wdir, int bufn)
|
||||||
|
{
|
||||||
|
USED(pid);
|
||||||
|
USED(wdir);
|
||||||
|
USED(bufn);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
getpts(int fd[], char *slave)
|
||||||
|
{
|
||||||
|
openpty(&fd[1], &fd[0], slave, 0, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include "9term.h"
|
#include "9term.h"
|
||||||
|
|
||||||
void
|
int
|
||||||
pdx(int pid, char *wdir, int bufn)
|
getchildwd(int pid, char *wdir, int bufn)
|
||||||
{
|
{
|
||||||
char path[256];
|
char path[256];
|
||||||
int n;
|
int n;
|
||||||
|
|
@ -9,8 +9,9 @@ pdx(int pid, char *wdir, int bufn)
|
||||||
snprint(path, sizeof path, "/proc/%d/cwd", pid);
|
snprint(path, sizeof path, "/proc/%d/cwd", pid);
|
||||||
n = readlink(path, wdir, bufn);
|
n = readlink(path, wdir, bufn);
|
||||||
if(n < 0)
|
if(n < 0)
|
||||||
n = 0;
|
return -1;
|
||||||
wdir[n] = '\0';
|
wdir[n] = '\0';
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue