Fix issue in returning cursor after print_above()#59
Fix issue in returning cursor after print_above()#59davidavdav wants to merge 2 commits intomeshcore-dev:mainfrom
Conversation
|
Hi, thanks very much for your PR, indeed I have just a little annoyement when using it, channel echoes does not handle emojis correctly. Some of those characters are larger and to accomodate with that I force the position from where path and signal strength are printed. It should look like :
but with your PR it looks like
cursor moving is done here : meshcore-cli/src/meshcore_cli/meshcore_cli.py Line 257 in 37b8273 using this part of the formated string : If you get this working again, I'll merge the PR ;) |
|
OK, great, on my terminal I don't get the I'll see if I can fix the problem. Originally the code split long lines into multiple, but I didn't bother with that, maybe this is causing that behavior |
|
this is handy to follow repeats from the repeaters |
|
I tried to fix the right-aligned texts now. You might find incidental over-compensation in the case of wide-characters in node names, but that is probably better than characters spilling over into the next line. BTW I do see the benefit of the channel echoes, although in my case incoming traffic usually are a few echoes between the same few repeaters in my area --- but I can see that my repeater picks up the most messages |
|
Hi, I'd suggest you to calculate the position of the cursor by calculating the size of the right aligned text (which only depends on the path length and should not contain emojis) and substracting this from the width of the terminal, this has proven more robust for me Sadly I don't have much time right now :( |


In my terminal (standard macos text terminal) the
print_above()does not return to the original place (just after the prompt). The problem is related to a mix ofPromptSessionand plainprint(), the DEC terminal escape sequences move the cursor withoutprompt_toolkitknowing about this. For me this results in a garbled terminal.This PR fixes it for me, but I don't have all the use cases, so I don't know what the effect will be in other terminals or OSs.
Full disclosure: the code and analysis was done by cursor (pun not intended). If this is not compliant with your coding policy, feel free to ignore this PR.