diff options
author | Mateusz Czapliński <czapkofan@gmail.com> | 2018-03-04 16:44:54 +0100 |
---|---|---|
committer | Mateusz Czapliński <czapkofan@gmail.com> | 2018-03-04 16:44:54 +0100 |
commit | 6bc88e9e5d565511a4eb3f0bb2ad1be416f32465 (patch) | |
tree | 7c965c2289d3ee7b2034d435e6dfec08d53ac134 | |
parent | 1525c1dfb5483611d9509b95f28c61039cc6c906 (diff) |
draw prompt
-rw-r--r-- | up.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -29,10 +29,14 @@ func main() { // In background, start collecting input from stdin to internal buffer of size 40 MB, then pause it go collect() - for x, ch := range "hello world! :)" { - termbox.SetCell(x, 0, ch, termbox.ColorWhite, termbox.ColorBlack) + // Draw command input line + prompt := "| " + for x, ch := range prompt { + termbox.SetCell(x, 0, ch, termbox.ColorWhite, termbox.ColorBlue) } + termbox.SetCursor(len(prompt), 0) termbox.Flush() + for { switch ev := termbox.PollEvent(); ev.Type { case termbox.EventKey: |