polyipseity / obsidian-terminal

Integrate consoles, shells, and terminals inside Obsidian.
GNU Affero General Public License v3.0
163 stars 7 forks source link

Console cursor in integrated console is misaligned with large commands #30

Closed AdamFipke closed 5 months ago

AdamFipke commented 1 year ago

Steps to reproduce:

  1. do command: Open current directory in terminal: Integrated
  2. start writing a long command. At a certain point, the terminal will line break the command.
  3. From here, move the cursor by either hitting backspace a lot or with the arrow keys. Once the second line is deleted, instead of going to the line above, it will move to either several lines above or below, seemingly dependent on the resolution of the terminal
polyipseity commented 1 year ago

Can you provide screenshots to show how the terminal looks like when broken?

polyipseity commented 5 months ago

I expect that there is a slight chance that this happens on Windows. This is because a somwhat hacky way is used to resize the terminal windows to be the same as the Obsidian tab size on Windows. If the caluclated sizes do not align exactly (e.g. off by 1), then the text position would start offsetting. This should not happen on Linux.

It's a bit difficult to fix and it works most of the time, so I am inclined to leave it as is. I would prefer using a proper solution instead of fixing this hacky solution.