Unverified Commit fef67c76 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Fix history file

parent 54e6832b
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ package repl

import (
	"fmt"
	"os"
	"path"
	"unicode"

@@ -13,12 +14,13 @@ import (

// Loop is the main event loop.
func Loop() error {
	// fmt.Printf("TODO: get config for user %s using xdg.\n", user)
	histdir := path.Join(xdg.ConfigHome, "BULLETIN")
	os.MkdirAll(histdir, 0700)
	histfile := path.Join(histdir, fmt.Sprintf("%s.history", this.User.Login))
	rl, err := readline.NewEx(
		&readline.Config{
			Prompt:      "BULLETIN> ",
			HistoryFile: path.Join(xdg.ConfigHome, "BULLETIN",
				fmt.Sprintf("%s.history", this.User.Login)),
			HistoryFile: histfile,
			// TODO: AutoComplete:    completer,
			InterruptPrompt:   "^C",
			EOFPrompt:         "EXIT",