]> git.mdlowis.com Git - projs/tide.git/commitdiff
Show the current dir in pty mode
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 14 Aug 2017 13:53:41 +0000 (09:53 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 14 Aug 2017 13:53:41 +0000 (09:53 -0400)
TODO.md
tide.c

diff --git a/TODO.md b/TODO.md
index cd3ae38560e1e47675676d7c465fbb8f60dc7d07..82d0b020ec91083b9b0eb16eb909bd098cab4aa1 100644 (file)
--- 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 7dd7a6e3e0d483d51bf8318e2d2b6b2e2228a6b2..e2bf28fbd2c5699e35388c886fa53a64b2a4faf5 100644 (file)
--- 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};
 }