Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

167
Visualizações
Proper line editing when using node.js for terminal app

I am making a command line interface to a Forth system running on an Arduino Nano using node.jsr. I am finding when trying to edit a line before accepting it with the enter key that I get unexpected results. When I press the left or right arrow keys I get ^[[D and ^[[C respectively rather than the cursor moving left or right. The following code provides an example:

process.stdin.on('data', (data) => {
    process.stdout.write(data)
});

If you run the above code, type a few characters then try to move back with the left arrow, ^[[D shows up rather than the cursor moving to the left. Does anyone know how to correct this behaviour?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda