Browse Source

Make console prompt configurable

master
HimbeerserverDE 1 year ago
parent
commit
157b82b1a5
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
  1. 7
      README.md
  2. 12
      console.go

7
README.md

@ -133,7 +133,12 @@ Description: If this is true the builtin chatcommands and the redirect error mes
> `command_prefix`
```
Type: String
Description: Prefix of proxy chat commands, default is #
Description: The prefix of proxy chat commands, default is #
```
> `console_prompt`
```
Type: String
Description: The text preceeding the console input, default is ${command_prefix}>
```
> `do_fallback`
```

12
console.go

@ -11,6 +11,16 @@ import (
var consoleInput []rune
func draw(msgs []string) {
prompt, ok := ConfKey("console_prompt").(string)
if !ok {
prefix, ok := ConfKey("command_prefix").(string)
if !ok {
prefix = "#"
}
prompt = prefix + ">"
}
gocurses.Clear()
row, _ := gocurses.Getmaxyx()
@ -20,7 +30,7 @@ func draw(msgs []string) {
gocurses.Mvaddstr(row-i-1, 0, msg)
i--
}
gocurses.Mvaddstr(row-i-1, 0, "> "+string(consoleInput))
gocurses.Mvaddstr(row-i-1, 0, prompt+string(consoleInput))
gocurses.Refresh()
}

Loading…
Cancel
Save