Store cwd in history

This commit is contained in:
Kovid Goyal
2022-11-02 08:06:52 +05:30
parent c8e8cb5ad5
commit 8574e136cd
2 changed files with 4 additions and 2 deletions

View File

@@ -120,7 +120,8 @@ func exec_command(rl *readline.Readline, cmdline string) bool {
if len(parsed_cmdline) == 0 {
return true
}
hi := readline.HistoryItem{Timestamp: time.Now(), Cmd: cmdline, ExitCode: -1}
cwd, _ := os.Getwd()
hi := readline.HistoryItem{Timestamp: time.Now(), Cmd: cmdline, ExitCode: -1, Cwd: cwd}
switch parsed_cmdline[0] {
case "exit":
hi.ExitCode = 0