influxdata / influx-cli

CLI for managing resources in InfluxDB v2
MIT License
63 stars 24 forks source link

[v1 shell] Shell does not properly clean up the terminal #441

Closed elyscape closed 1 year ago

elyscape commented 2 years ago

When quitting the InfluxQL shell, it doesn't properly clean up the terminal. This results in the user needing to run stty sane in order to restore proper functioning of their terminal (e.g. echo of keys typed).

Steps to reproduce:

  1. Run influx v1 shell
  2. Type quit to quit
  3. Enter a new command on the command line

Expected behavior: The terminal behaves as it did prior to launching influx v1 shell.

Actual behavior: Typed characters are not echoed to the console.

Environment info:

Root cause: This happens due to c-bata/go-prompt#228 (see my comment for an explanation). A fix is available in c-bata/go-prompt#263.

elyscape commented 2 years ago

I went ahead and opened influxdata/go-prompt#1 to get the fix into your fork of go-prompt.

elyscape commented 1 year ago

Pinging @candrewlee14 and @lesam, who worked on this.