pinosaur
/
st.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
close master/slave pty in the shell process.
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
2e0ef70
..
e288902
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-136,6
+136,7
@@
static void tinsertblankline(int);
static void tmoveto(int, int);
static void tnew(int, int);
static void tnewline(void);
static void tmoveto(int, int);
static void tnew(int, int);
static void tnewline(void);
+static void tputtab(void);
static void tputc(char);
static void tputs(char*, int);
static void treset(void);
static void tputc(char);
static void tputs(char*, int);
static void treset(void);
@@
-152,6
+153,9
@@
static void ttyread(void);
static void ttyresize(int, int);
static void ttywrite(const char *, size_t);
static void ttyresize(int, int);
static void ttywrite(const char *, size_t);
+static void xbell(void);
+static void xdraws(char *, Glyph, int, int, int);
+static void xhints(void);
static void xclear(int, int, int, int);
static void xcursor(int);
static void xinit(void);
static void xclear(int, int, int, int);
static void xcursor(int);
static void xinit(void);
@@
-243,7
+247,7
@@
ttynew(void) {
if((m = posix_openpt(O_RDWR | O_NOCTTY)) < 0)
die("openpt failed: %s\n", SERRNO);
if(grantpt(m) < 0)
if((m = posix_openpt(O_RDWR | O_NOCTTY)) < 0)
die("openpt failed: %s\n", SERRNO);
if(grantpt(m) < 0)
- die("gran
d
pt failed: %s\n", SERRNO);
+ die("gran
t
pt failed: %s\n", SERRNO);
if(unlockpt(m) < 0)
die("unlockpt failed: %s\n", SERRNO);
if(!(pts = ptsname(m)))
if(unlockpt(m) < 0)
die("unlockpt failed: %s\n", SERRNO);
if(!(pts = ptsname(m)))
@@
-261,7
+265,9
@@
ttynew(void) {
dup2(s, STDOUT_FILENO);
dup2(s, STDERR_FILENO);
if(ioctl(s, TIOCSCTTY, NULL) < 0)
dup2(s, STDOUT_FILENO);
dup2(s, STDERR_FILENO);
if(ioctl(s, TIOCSCTTY, NULL) < 0)
- die("ioctl TTIOCSTTY failed: %s\n", SERRNO);
+ die("ioctl TIOCSCTTY failed: %s\n", SERRNO);
+ close(s);
+ close(m);
execsh();
break;
default:
execsh();
break;
default:
@@
-857,12
+863,7
@@
csireset(void) {
void
tputtab(void) {
int space = TAB - term.c.x % TAB;
void
tputtab(void) {
int space = TAB - term.c.x % TAB;
-
- if(term.c.x + space >= term.col)
- space--;
-
- for(; space > 0; space--)
- tmovecursor(CURSOR_RIGHT);
+ tmoveto(term.c.x + space, term.c.y);
}
void
}
void