So I am new to low level stuff so pardon my ignorance. I am attempting to write a minimal shell. To that end I want to implement command history similar to bash or zsh where an up-arrow can bring the most recent command up and put it in your typing field without actually inputting it.
Currently I am reading input like follows:
for {
// prompter
promptColor.Printf(shellPrompt)
// read string from STDIN until newline
input, _ := reader.ReadString('\n')
// convert CRLF to LF
input = strings.Replace(input, "\n", "", -1)
// read input tokens
tokens := SplitString(input)
// parse tokens and execute relevant command
Parse(tokens)
}
using bufio.Reader to read in. I looked and I cannot find a method of writing to that input.