Browse Source

Add editing command

master
Matthew Faltys 5 years ago
parent
commit
1f162af3e4
  1. 11
      nethack-launcher.go

11
nethack-launcher.go

@ -198,6 +198,17 @@ func printUserScreen(redisClient *redis.Client, username string) string {
exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run() exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run()
clearScreen() clearScreen()
printWelcomeScreen(redisClient) printWelcomeScreen(redisClient)
case "e":
hackRCLoc := fmt.Sprintf("%s/user/%s/.nethackrc", config.NethackLauncher.HackDir, username)
exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run()
clearScreen()
nh := exec.Command("vim", hackRCLoc)
nh.Stdout = os.Stdout
nh.Stdin = os.Stdin
nh.Stderr = os.Stderr
nh.Run()
clearScree()
printUserScreen(redisClient, username)
case "w": case "w":
clearScreen() clearScreen()
printProgressScreen(redisClient, username) printProgressScreen(redisClient, username)

Loading…
Cancel
Save