fix multiline prompts with "delimiter chars"
(only the last line of the prompt is redrawn, keep this in mind when doing the ANSI colour game) TODO: * maybe go back up one line and redraw whole prompt? * optionally edit command on multiple lines, bash-like, instead of scrolling horizontally
This commit is contained in:
parent
a15c5c319a
commit
857fb659bc
4
edit.c
4
edit.c
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.27 2006/08/01 14:35:43 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.28 2006/08/01 14:59:50 tg Exp $");
|
||||||
|
|
||||||
/* tty driver characters we are interested in */
|
/* tty driver characters we are interested in */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -1941,7 +1941,7 @@ x_redraw(int limit)
|
|||||||
pprompt(prompt + prompt_skip, x_trunc);
|
pprompt(prompt + prompt_skip, x_trunc);
|
||||||
}
|
}
|
||||||
if (x_col > xx_cols)
|
if (x_col > xx_cols)
|
||||||
x_col = x_col - (x_col / xx_cols) * xx_cols;
|
x_col %= xx_cols;
|
||||||
x_displen = xx_cols - 2 - x_col;
|
x_displen = xx_cols - 2 - x_col;
|
||||||
if (x_displen < 1) {
|
if (x_displen < 1) {
|
||||||
x_col = 0;
|
x_col = 0;
|
||||||
|
7
lex.c
7
lex.c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.17 2006/08/01 14:35:44 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.18 2006/08/01 14:59:51 tg Exp $");
|
||||||
|
|
||||||
/* Structure to keep track of the lexing state and the various pieces of info
|
/* Structure to keep track of the lexing state and the various pieces of info
|
||||||
* needed for each particular state. */
|
* needed for each particular state. */
|
||||||
@ -1106,9 +1106,10 @@ dopprompt(const char *cp, int ntruncate, const char **spp, int doprint)
|
|||||||
cp += 2;
|
cp += 2;
|
||||||
}
|
}
|
||||||
for (; *cp; cp++) {
|
for (; *cp; cp++) {
|
||||||
if (!indelimit && ntruncate)
|
if (ntruncate) {
|
||||||
|
if (!(indelimit || (*cp == delimiter)))
|
||||||
--ntruncate;
|
--ntruncate;
|
||||||
else if (doprint) {
|
} else if (doprint) {
|
||||||
shf_puts(cp, shl_out);
|
shf_puts(cp, shl_out);
|
||||||
doprint = 0;
|
doprint = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user