Shell prints input line when run with NewWithConfig on different terminal
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Esamina la funzione NewWithConfig in ishell.go e il modo in cui interagisce con readline.Config. È probabile che il problema riguardi il campo StdinWriter, che causa un doppio echo. Esamina come la libreria readline gestisce i flussi di input/output quando viene configurata con un terminale personalizzato. Prova modificando la configurazione e collegandoti tramite netcat per verificare se la duplicazione si interrompe.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Apols if I'm making a mistake here and this is not a bug - I would like to be able to access ishell through another terminal instance on Linux with go 1.12.5. So first, I set up a listener (leaving out error handling and defer here to keep the code short):
listener, err := net.Listen("tcp", host)
conn, err := listener.Accept()
where host is "localhost:8000" for testing. Next, I've imported "github.com/abiosoft/readline" to be able to run the shell with the listener's connection parameters in the configuration for NewWithConfig:
termCfg := &readline.Config{
Stdin: io.ReadCloser(conn),
Stdout: io.Writer(conn),
StdinWriter: io.Writer(conn),
Stderr: io.Writer(conn),
}
Then I start the shell in a second terminal window through the listener:
shell := ishell.NewWithConfig(termCfg)
shell.Run()
This works fine when I open another shell and connect with nc localhost 8000 - except for the fact that after I type in a command such as help, the input line is not only echoed character for character as expected, but then printed again, giving me stuff like
> help
> help
Commands:
clear clear the screen
exit exit the program
help display help
I'm wondering if StdinWriter is the problem here, but changing that doesn't seem to help. I can't find an example for NewWithConfig in the docs. Is this a bug or am I missing something obvious? Thanks!
- Lingua principale
- Go
- Stelle
- 1.8k
- Fork
- 213
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di abiosoft/ishell
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
History file handle leak Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Tutte le issue di abiosoft/ishell
Issue simili
-
nix: vendorHash is outdated Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Bob Shell support Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
santhosh-tekuri/jsonschema#276 ·