feat: show current path in the prompt.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Changes to be committed:
#	modified:   TODO.txt
#	modified:   define.h
#	modified:   exec.c
#	modified:   exec.h
#	modified:   main.c
#
# Changes not staged for commit:
#	modified:   test/test_exec.txt
#
# Untracked files:
#	keys.txt
#	tags
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/TODO.txt b/TODO.txt
index 638844d..416c1f6 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -3,3 +3,4 @@
 [] Implement '<<' functionality
 [] Implement '{}' functionality
 [] Implement '()' functionality
+[] If a pair of procs are started in bg, and i want to wait next proc?
diff --git a/define.h b/define.h
index a7a84f9..19caa79 100644
--- a/define.h
+++ b/define.h
@@ -8,6 +8,7 @@
 #define BACKSLASH '\\'
 #define AMPERSAND '&'
 #define DEFAULT_BUFF_SIZE 1024
+#define PATH_LEN_MAX 4096
 #define FD_ERR -1

 typedef enum def_delim {
diff --git a/exec.c b/exec.c
index deb37a2..c338802 100644
--- a/exec.c
+++ b/exec.c
@@ -10,8 +10,8 @@
 /* r = <    rr = <<     w = >   a = >> */
 typedef enum def_fd_opt { opt_err, opt_r, opt_rr, opt_w, opt_a } fd_opt;

-static int fork_exec_argv(char **argv, int *cmd_fd, int flag_wait)
 /* cmd_fd[2] should be all with O_CLOEXEC */
+static int fork_exec_argv(char **argv, int *cmd_fd, int flag_wait)
 {
     int pid, status, res = 0;
     if(argv && *argv) {
@@ -40,7 +40,7 @@ static int fork_exec_argv(char **argv, int *cmd_fd, int flag_wait)
             if(WIFEXITED(status))
                 res = WEXITSTATUS(status);
             else
-                res = -1; /* any recieved fatal signal counts as an err */
+                res = -1; /* any recieved fatal signals count as an err */
         }
         /* if no wait -> success returned */
     }
@@ -48,7 +48,47 @@ static int fork_exec_argv(char **argv, int *cmd_fd, int flag_wait)
     return res;
 }

-char **word_list_part_to_argv(word *head, int len)
+int exec_get_current_path(char *buff, int bufflen)
+{
+    int fds[2];
+    int pid, res = -1;
+    char *argv[] = { "pwd", NULL };
+    if(!buff) {
+        fprintf(stderr, "get_current_path: buff = NULL\n");
+        return 0;
+    }
+
+    pipe(fds);
+    pid = fork();
+    if(pid == -1) {
+        perror(NULL);
+        return 0;
+    }
+    if(pid == 0) {
+        close(fds[0]);
+        dup2(fds[1], 1);
+        close(fds[1]);
+        execvp(argv[0], argv);
+        perror(argv[0]);
+        fflush(stderr);
+        _exit(1);
+    }
+    wait(NULL);
+    close(fds[1]);
+    res = read(fds[0], buff, bufflen-1);
+    close(fds[0]);
+    if(-1 == res) {
+        perror(argv[0]);
+        return 0;
+    }
+    if(buff[res-1] == '\n')
+        buff[res-1] = '\0';
+    else
+        buff[res] = '\0';
+    return 1;
+}
+
+static char **word_list_part_to_argv(word *head, int len)
 {
     int idx;
     word *tmp;
@@ -125,7 +165,7 @@ static int get_file_fd(char *fname, fd_opt opt)
     return fd;
 }

-void word_delim_handle(char *fname, delim dl, int *cmd_fd)
+static void word_delim_handle(char *fname, delim dl, int *cmd_fd)
 {
     /* <, <<, >, >> */
     int fd = FD_ERR;
@@ -149,8 +189,8 @@ void word_delim_handle(char *fname, delim dl, int *cmd_fd)
     }
 }

-static int is_cmd_should_exec(delim prev_cmd_dl, int prev_cmd_ret)
 /* arguments are the result from the previous executed command */
+static int is_cmd_should_exec(delim prev_cmd_dl, int prev_cmd_ret)
 {
     int flag_exec = 1;
     if(prev_cmd_dl == delim_logical_or && prev_cmd_ret == 0)
@@ -205,9 +245,9 @@ static void fd_pipe_arr_copy(int *src, int *dst)
     dst[1] = src[1];
 }

-static word *cmd_process(word *head, int *cmd_len, int *cmd_fd, delim *dl)
 /* returns head of a next command if there is, or NULL if not */
 /* defines cmd settings and returns into parameters */
+static word *cmd_process(word *head, int *cmd_len, int *cmd_fd, delim *dl)
 {
     int len, was_delim = 0;
     delim local_dl = delim_err;
@@ -222,6 +262,7 @@ static word *cmd_process(word *head, int *cmd_len, int *cmd_fd, delim *dl)
             len = strlen(head->str);
             if(is_word_delim(head->str, len, &local_dl)) {
                 fd_pipe_arr_copy(cmd_fd, old_cmd_fd);
+                /* makes relative redirs, opens files if needed */
                 word_delim_handle(head->next->str, local_dl, cmd_fd);
                 /* closing the not needed file descriptors */
                 if(old_cmd_fd[0] != FD_ERR)
@@ -283,7 +324,6 @@ static void proc_wait_later_handle(int *proc_cnt, delim dl, int flag_wait)

 5)Move to next [cmd]; Repeat.
 */
-
 void exec_word_list_handle(word_list *list)
 {
     delim cmd_dl = delim_err, prev_cmd_dl = delim_err;
@@ -318,7 +358,7 @@ void exec_word_list_handle(word_list *list)
                                                   pipe_fd_next);
         proc_wait_later_handle(&proc_wait_later_cnt, cmd_dl, flag_wait);
         cmd_res = cmd_exec_handle(head, cmd_len, flag_wait, cmd_fd);
-        if(cmd_dl == delim_ampersand) {
+        if(flag_wait < 1) {
             printf("%i\n", cmd_res); /* cmd_res eq pid of bg process */
             cmd_res = 0;
         }
diff --git a/exec.h b/exec.h
index 39eb210..7b1b183 100644
--- a/exec.h
+++ b/exec.h
@@ -4,7 +4,7 @@
 #include "char.h"

 void exec_word_list_handle(word_list *list);
-void exec_word_delim_handle(char *fname, delim dl, int *fd0, int *fd1);
+int  exec_get_current_path(char *buff, int bufflen);

 #endif

diff --git a/main.c b/main.c
index b431799..23c255d 100644
--- a/main.c
+++ b/main.c
@@ -8,6 +8,7 @@
 #include "syntax.h"
 #include "exec.h"

+char cur_path[PATH_LEN_MAX];
 int only_print_tokens = 0;

 typedef enum input_state {
@@ -17,7 +18,7 @@ typedef enum input_state {
 } input_state;


-static void print_invitation() { printf("> "); }
+static void print_invitation() { printf("%s> ", cur_path); }

 static input_state read_loop(char **buffptr, int *size)
 {
@@ -38,8 +39,9 @@ static input_state read_loop(char **buffptr, int *size)
         i = 0;
     }

-    if(tty)
+    if(tty) {
         print_invitation();
+    }

     for( ; (c = getchar()) != EOF; i++) {
         if(c == '\n') {
@@ -126,11 +128,13 @@ static void loop()
         /* step (tokenization) */
         wl = word_list_from_buff(buff);

-        if(only_print_tokens)
+        if(only_print_tokens) {
             word_list_print(wl);
-        else
+            goto memfree;
+        } else {
             /* step (execution) */
             exec_word_list_handle(wl);
+        }
 memfree:
         mem_free(&argv, &buff, &wl);
         if(fin_flag)
@@ -142,27 +146,7 @@ int main(int argc, char* argv[])
 {
     if(argc > 1 && 0 == strcmp(argv[1], "-s"))
         only_print_tokens = 1; /* do not execute. for debug purposes */
+    exec_get_current_path(cur_path, PATH_LEN_MAX);
     loop();
     return 0;
 }
-
-#if 0
-static void check_eof(int c)
-{
-    int term = isatty(0);
-    int fl_gotchar = 0;
-    if(!term) {
-        if(c == '\n') {
-            c = getchar();
-            fl_gotchar = 1;
-        }
-    }
-    if(c == EOF) {
-        if(term)
-            printf("\nEOF catched. Exiting...\n");
-        exit(0);
-    }
-    if(fl_gotchar)
-        ungetc(c, stdin);
-}
-#endif
