Make console prompt configurable

master
HimbeerserverDE 2021-04-03 21:18:11 +02:00
parent 6e6e195bcf
commit 157b82b1a5
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
2 changed files with 17 additions and 2 deletions

View File

@ -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`
```

View File

@ -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()
}