Shell prints input line when run with NewWithConfig on different terminal
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Examina la función NewWithConfig en ishell.go y cómo interactúa con readline.Config. Es probable que el problema esté relacionado con que el campo StdinWriter provoca un eco doble. Examina cómo la biblioteca readline gestiona los flujos de entrada/salida cuando se configura con un terminal personalizado. Prueba a modificar la configuración y conectarte mediante netcat para comprobar si la duplicación se detiene.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- Go
- Estrellas
- 1.8k
- Forks
- 213
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de abiosoft/ishell
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
-
History file handle leak Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Todos los issues de abiosoft/ishell
Issues similares
-
bug github_actions
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
registrystack/registry-stack#1393 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
JakeChampion/lang#10213 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100