summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Czapliński <czapkofan@gmail.com>2018-03-04 16:44:54 +0100
committerMateusz Czapliński <czapkofan@gmail.com>2018-03-04 16:44:54 +0100
commit6bc88e9e5d565511a4eb3f0bb2ad1be416f32465 (patch)
tree7c965c2289d3ee7b2034d435e6dfec08d53ac134
parent1525c1dfb5483611d9509b95f28c61039cc6c906 (diff)
draw prompt
-rw-r--r--up.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/up.go b/up.go
index 7a76919..d44ad63 100644
--- a/up.go
+++ b/up.go
@@ -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: