jonmbake / react-terminal-ui

A terminal react component with support for light and dark modes.
https://jonmbake.github.io/react-terminal-ui/demo/
MIT License
205 stars 30 forks source link

wrong cursor position #34

Closed MohammadSabriExalt closed 1 year ago

MohammadSabriExalt commented 1 year ago

An ambiguous behavior happens when I write some characters in the terminal and click on the left arrow, the cursor position indicates that I am at the last character, but actually it's behind it.

The issue will be clear when i tried to clean what was written and press the backspace, it will leave some characters unremoved

To Reproduce

  1. write some characters to the terminal :ex 'ABCD'
  2. press the left arrow 3 times
  3. wrie another characters ex: 'EFG'
  4. the terminal shows (AEFGBCD)
  5. press down and hold the backspace to remove all
  6. The terminal will shows "BCD" and the cursor blinking after the "D"

Expected behavior clear indication for the cursor position

Screenshots If applicable, add screenshots to help explain your problem. image image image

github-actions[bot] commented 1 year ago

Thank you for taking the time to submit an Issue! You should get a response to this issue within one to two days.

jonmbake commented 1 year ago

@MohammadSabriExalt Thanks for opening this issue. I'll work on fixing it within the next few days.

jonmbake commented 1 year ago

Fixed the bug. Opened a feature request, https://github.com/jonmbake/react-terminal-ui/issues/36, to add support for moving cursor with left/right arrows.

MohammadSabriExalt commented 1 year ago

@jonmbake , I appreciate the time and effort you put into this