From: Michael D. Lowis Date: Mon, 14 Aug 2017 13:53:41 +0000 (-0400) Subject: Show the current dir in pty mode X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=d5341481588114a66551bc132715b578e3c1b9d7;p=projs%2Ftide.git Show the current dir in pty mode --- diff --git a/TODO.md b/TODO.md index cd3ae38..82d0b02 100644 --- a/TODO.md +++ b/TODO.md @@ -3,13 +3,12 @@ Up Next: * Implement tab completion -* Change status to current dir in pty mode. * synchronize title with status contents. -* Implement server daemon for tracking open files * B2+B1 click executes command with selection as argument -* right click to fetch file or line * Run commands in the background and don't block the main thread. * update man pages with new functionality +* tfetch variable expansion needs to be reworked +* rename tide to twin and tctl to tide * moving from tags to the gutter does not transfer focus to edit region * implement transaction control in buf.c diff --git a/tide.c b/tide.c index 7dd7a6e..e2bf28f 100644 --- a/tide.c +++ b/tide.c @@ -497,9 +497,15 @@ void onupdate(void) { *(status++) = (SearchDir < 0 ? '<' : '>'); *(status++) = (buf->modified ? '*' : ' '); *(status++) = ' '; - char* path = (buf->path ? buf->path : "*scratch*"); size_t remlen = sizeof(status_bytes) - strlen(status_bytes) - 1; - strncat(status, path, remlen); + if (pty_active()) { + char* path = getcurrdir(); + strncat(status, path, remlen); + free(path); + } else { + char* path = (buf->path ? buf->path : "*scratch*"); + strncat(status, path, remlen); + } win_settext(STATUS, status_bytes); win_view(STATUS)->selection = (Sel){0,0,0}; }