Add basic history operations

This commit is contained in:
Kovid Goyal
2022-11-04 20:13:10 +05:30
parent f77d07259a
commit e1ab2383b3
5 changed files with 136 additions and 13 deletions

View File

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