tb Print colorful shell prompt and logged cmds, print terminal W/H

This commit is contained in:
2025-11-15 00:58:40 +01:00
parent 7da422fdb6
commit af27592957
2 changed files with 6 additions and 2 deletions

View File

@ -195,7 +195,7 @@ bool interp_runstring(char *string, InterpResult **res, bool interactive) {
char *line = string_tokenizealloc_linecontinue(string, "\n"); char *line = string_tokenizealloc_linecontinue(string, "\n");
while (line != NULL) { while (line != NULL) {
if (CONFIG.logcmds) { if (CONFIG.logcmds) {
uprintf("+%s\n", line); uprintf("+"ANSIQ_SETFG_YELLOW"%s"ANSIQ_GR_RESET"\n", line);
} }
bool skip; bool skip;

View File

@ -78,11 +78,15 @@ done:
} }
void do_mode_interactive(void) { void do_mode_interactive(void) {
uint16_t w, h;
term_getsizes(&w, &h);
uprintf("TERMINAL: %ux%u\n", (uint32_t)w, (uint32_t)h);
char linebuf[LINEBUF_MAX]; char linebuf[LINEBUF_MAX];
size_t cursor; size_t cursor;
for(;;) { for(;;) {
begin: begin:
uprintf("tb# "); uprintf("["ANSIQ_SETFG_RGB(0, 163, 255)"TB"ANSIQ_GR_RESET"]# ");
cursor = 0; cursor = 0;
string_memset(linebuf, 0, LINEBUF_MAX); string_memset(linebuf, 0, LINEBUF_MAX);