Skip to content

Commit

Permalink
fixes #19 for real
Browse files Browse the repository at this point in the history
  • Loading branch information
mhausenblas committed Feb 6, 2018
1 parent f218c1a commit dd33eba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions envs.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ func setprompt() {
}
env := currentenv().name
debug(env + " " + context + " " + namespace)
switch env {
case globalEnv:
rl.SetPrompt(fmt.Sprintf("[\033[32m%s\033[0m::\033[36m%s\033[0m]$ ", context, namespace))
default:
rl.SetPrompt(fmt.Sprintf("[\033[95m%s\033[0m@\033[32m%s\033[0m::\033[36m%s\033[0m]$ ", env, context, namespace))
if rl != nil {
switch env {
case globalEnv:
rl.SetPrompt(fmt.Sprintf("[\033[32m%s\033[0m::\033[36m%s\033[0m]$ ", context, namespace))
default:
rl.SetPrompt(fmt.Sprintf("[\033[95m%s\033[0m@\033[32m%s\033[0m::\033[36m%s\033[0m]$ ", env, context, namespace))
}
}
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func main() {
if err != nil {
warn("Encountered issues during startup: " + err.Error())
}
rl, err := readline.NewEx(&readline.Config{
rl, err = readline.NewEx(&readline.Config{
AutoComplete: completer,
HistoryFile: "/tmp/readline.tmp",
InterruptPrompt: "^C",
Expand Down

0 comments on commit dd33eba

Please sign in to comment.