terminal-in-react icon indicating copy to clipboard operation
terminal-in-react copied to clipboard

edit-line command return multiple lines instead of one

Open Alex100dre opened this issue 6 years ago • 3 comments

Hello, thanks for this awesome component 🙂

I tried to implement the type-text from advanced commands examples which use the edit-line built in command that is supposed to edit the last line.

commands={{
  'type-text': (args, print, runCommand) => {
    const text = args.slice(1).join(' ')
    print('')
    for (let i = 0; i < text.length; i += 1) {
      setTimeout(() => {
        runCommand(`edit-line ${text.slice(0, i + 1)}`)
      }, 100 * i)
    }
  },
}}

But instead of getting the last line updating, it return a new line at each iteration.

> type-text hello
 
h
he
hel
hell
hello

Any idea of what could cause this? 🤔

Alex100dre avatar Jan 20 '19 05:01 Alex100dre

@Alex100dre i got the same issue did you fix it ?

JustinMartinDev avatar Feb 26 '19 23:02 JustinMartinDev

Sadly not. I didn't spent time on it for the moment.

Let me know if you find something.

I'll do the same on my side.

Alex100dre avatar Feb 27 '19 00:02 Alex100dre

any solution?

HugoLiconV avatar Nov 17 '19 05:11 HugoLiconV