mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.93k stars 714 forks source link

[BUG] kakoune used in aerc cause redrawing issue #4689

Open stacyharper opened 2 years ago

stacyharper commented 2 years ago

Version of Kakoune

2021.11.08-r1 (Alpine Linux)

Reproducer

Setup EDITOR=kak and use a basic aerc config. Try to reply-quote to a mail

Outcome

Sometime redrawing is completly broken: Here a short vod that show the issue on the third tentative.

https://tube.missbanal.net/w/e4ab1d4d-73b9-442c-99ea-9aeb234631e7

Expectations

Kakoune shoult redraw itself correctly while embeded

Additional information

I'm on Alpine Linux Edge and up to date (22-07-28). This issue happen on foot or xterm, on tmux or not. This issue never happen with say vim.

I already asked aerc guys and they guess it is kakoune related cause the issue is yet unknown with other editors (vim, nano, etc).

0x5424 commented 2 years ago

Though I'm not using the aerc client, I'm experiencing similar after building from source (commit hash 360a6847be5c).

Distro: Ubuntu server 20.04.5

It's not present in the package published in apt, which is quite old (A build from December 2019)

Attached a short clip before & after starting a tmux session. I can also confirm xterm works fine https://user-images.githubusercontent.com/25315226/195968296-fc93363b-bfd7-45d4-9a7f-811ef6ad8da4.MOV

Screwtapello commented 2 years ago

You say xterm works fine, and tmux (which is technically a terminal, as far as Kakoune is concerned) works fine. Which terminal causes problems, and does it still cause problems if you launch Kakoune without its configuration (kak -n)?

0x5424 commented 1 year ago

It's a bit puzzling as I've tested a few different configurations... but I've identified the problem to be the SSH client I used to test on mobile. My apologies, as it may be more appropriate to report to their issue tracker instead.


does it still cause problems if you launch Kakoune without it's configuration

The issue still appeared, with or without the kakrc. Unfortunately, the ssh client is a freemium closed-source product so I cannot provide any additional debug info.

In the event it somehow helps the Kakoune team with the titular issue, I've attached a few screenshots.

  1. The first is running kak -n.
  2. The second uses a kakrc with set-option global ui_options terminal_status_on_top=true.
  3. The third screenshot is the terminal window after quitting a kakoune client which used terminal_status_on_top=true. It prints the final state of the status bar before quitting (notice the :q )
  4. A one-off error I wasn't able to reproduce again, wherein mojibake prints to line 2 using the same Information face from the changelog. This also had terminal_status_on_top=true
Terminal status on bottom (kak -n)
Terminal status on top
After closing a session with terminal status on top
Mojibake following changelog

The client only seems to only draw the final line of the ui. Hope this may be of some use.

Screwtapello commented 1 year ago

Unfortunately, terminal technology is in a similar place to the where HTML and browsers were before HTML5: there's a great number of independently-implemented producers and consumers, but no solid community-accepted interoperable standard. Since there's no standard to test against, each producer only tests against the five (or so) most common consumers, and each consumer only tests against the five (or so) most common producers. As a result, there's a lot of scope for somebody to say "I'll just cut this corner and I'm sure it'll be fine" and it is fine until somebody tries to run a niche editor in a niche terminal emulator and all hell breaks loose.

Clearly Kakoune is doing something that confuses Termius, but I've never seen that particular behaviour before and it's hard to guess what the problem might be. If I had to investigate further, my plan would be:

  1. use the script tool to run Kakoune and capture all of its output, including escape sequences, to a file:

    script -c "kak -n" output-log.txt
  2. When Kakoune appears, verify the output is still glitchy

  3. quit Kakoune with :q

  4. cat output-log.txt to verify that it more-or-less produces the same result

  5. start bisecting output-log.txt to find some escape sequence where up to that point, catting the file produces reasonable output, but after that point it glitches

It'll help to recognise the escape sequences Kakoune produces on startup to configure the terminal:

https://github.com/mawww/kakoune/blob/287217b98715faaddab019f4e17ab54fccaaec70/src/terminal_ui.cc#L1414-L1423

...and also a list of control sequences most terminals understand.

Also, since you mention mojibake, make sure that you're using a UTF-8 locale (run the locale command and verify each category ends in .UTF-8 or .utf8) before starting Kakoune.

stacyharper commented 1 year ago

You say xterm works fine, and tmux (which is technically a terminal, as far as Kakoune is concerned) works fine. Which terminal causes problems, and does it still cause problems if you launch Kakoune without its configuration (kak -n)?

No I said xterm or foot, tmux or not, all of them have the issue.

stacyharper commented 1 year ago

Here the content of the mail :

On Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:                                                                                                        
> Unfortunately, terminal technology is in a similar place to the where HTML and browsers were before HTML5: there's a great number of independently-implemented
>                                                                                                                                                               
> Clearly Kakoune is doing something that confuses Termius, but I've never seen that particular behaviour before and it's hard to guess what the problem might b
>                                                                                                                                                               
> 1. use the `script` tool to run Kakoune and capture all of its output, including escape sequences, to a file:                                                 
>                                                                                                                                                               
>         script -c "kak -n" output-log.txt                                                                                                                     
>                                                                                                                                                               
> 2. When Kakoune appears, verify the output is still glitchy                                                                                                   
> 3. quit Kakoune with `:q`                                                                                                                                     
> 4. `cat output-log.txt` to verify that it more-or-less produces the same result                                                                               
> 5. start bisecting `output-log.txt` to find some escape sequence where up to that point, `cat`ting the file produces reasonable output, but after that point i
>                                                                                                                                                               
> It'll help to recognise the escape sequences Kakoune produces on startup to configure the terminal:                                                           
>                                                                                                                                                               
> https://github.com/mawww/kakoune/blob/287217b98715faaddab019f4e17ab54fccaaec70/src/terminal_ui.cc#L1414-L1423                                                 
>                                                                                                                                                               
> ...and also [a list of control sequences most terminals understand](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Controls-beginning-with-ESC).  
>                                                                                                                                                               
> Also, since you mention mojibake, make sure that you're using a UTF-8 locale (run the `locale` command and verify each category ends in `.UTF-8` or `.utf8`) b
>                                                                                                                                                               
> --                                                                                                                                                            
> Reply to this email directly or view it on GitHub:                                                                                                            
> https://github.com/mawww/kakoune/issues/4689#issuecomment-1280381424                                                                                          
> You are receiving this because you authored the thread.                                                                                                       
>                                                                                                                                                               

I typed l until the highlighted char ~is~ was arround 1 as in On Mon Oct 17, 2022 and it started to glitch. Here the typescript file as it it just after the last l keybind trigger.

Script started on 2022-10-17 11:02:43+02:00 [COMMAND="kak -n /tmp/aerc-compose-3282581247.eml" TERM="foot" TTY="/dev/pts/6" COLUMNS="160" LINES="37"]
[?1049h[?1004h[>4;1m[>5u[?25l=[?2026$p[?1006h[?1000h[?1002h]2;/tmp/aerc-compose-3282581247.eml 1:1  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:> Unfortunately, terminal technology is in a similar place to the where HTML and browsers were before HTML5: there's a great number of independently-implemented>> Clearly Kakoune is doing something that confuses Termius, but I've never seen that particular behaviour before and it's hard to guess what the problem might b>> 1. use the `script` tool to run Kakoune and capture all of its output, including escape sequences, to a file:>>         script -c "kak -n" output-log.txt>> 2. When Kakoune appears, verify the output is still glitchy> 3. quit Kakoune with `:q`> 4. `cat output-log.txt` to verify that it more-or-less produces the same result> 5. start bisecting `output-log.txt` to find some escape sequence where up to that point, `cat`ting the file produces reasonable output, but after that point i>> It'll help to recognise the escape sequences Kakoune produces on startup to configure the terminal:>> https://github.com/mawww/kakoune/blob/287217b98715faaddab019f4e17ab54fccaaec70/src/terminal_ui.cc#L1414-L1423>> ...and also [a list of control sequences most terminals understand](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Controls-beginning-with-ESC).  >> Also, since you mention mojibake, make sure that you're using a UTF-8 locale (run the `locale` command and verify each category ends in `.UTF-8` or `.utf8`) b>> -- > Reply to this email directly or view it on GitHub:> https://github.com/mawww/kakoune/issues/4689#issuecomment-1280381424> You are receiving this because you authored the thread.>> Message ID: <mawww/kakoune/issues/4689/1280381424@github.com>~~~~~~~/tmp/aerc-compose-3282581247.eml 1:1  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:1  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:> Unfortunately, terminal technology is in a similar place to the where HTML and browsers were before HTML5: there's a great number of independently-implemented>> Clearly Kakoune is doing something that confuses Termius, but I've never seen that particular behaviour before and it's hard to guess what the problem might b>> 1. use the `script` tool to run Kakoune and capture all of its output, including escape sequences, to a file:>>         script -c "kak -n" output-log.txt>> 2. When Kakoune appears, verify the output is still glitchy> 3. quit Kakoune with `:q`> 4. `cat output-log.txt` to verify that it more-or-less produces the same result> 5. start bisecting `output-log.txt` to find some escape sequence where up to that point, `cat`ting the file produces reasonable output, but after that point i>> It'll help to recognise the escape sequences Kakoune produces on startup to configure the terminal:>> https://github.com/mawww/kakoune/blob/287217b98715faaddab019f4e17ab54fccaaec70/src/terminal_ui.cc#L1414-L1423>> ...and also [a list of control sequences most terminals understand](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Controls-beginning-with-ESC).  >> Also, since you mention mojibake, make sure that you're using a UTF-8 locale (run the `locale` command and verify each category ends in `.UTF-8` or `.utf8`) b>> -- > Reply to this email directly or view it on GitHub:> https://github.com/mawww/kakoune/issues/4689#issuecomment-1280381424> You are receiving this because you authored the thread.>> Message ID: <mawww/kakoune/issues/4689/1280381424@github.com>~~~~~~~/tmp/aerc-compose-3282581247.eml 1:1  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:2  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-3282581247.eml 1:2  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:3  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-3282581247.eml 1:3  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:4  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-3282581247.eml 1:4  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:5  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-3282581247.eml 1:5  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:6  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-3282581247.eml 1:6  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:7  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-3282581247.eml 1:7  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:8  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-3282581247.eml 1:8  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:9  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-3282581247.eml 1:9  1 sel - client0@[15027]]2;/tmp/aerc-compose-3282581247.eml 1:10  1 sel - client0@[15027] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-3282581247.eml 1:10  1 sel - client0@[15027]

Here another typescript with the exact same reproduction steps (in case I failed the first one)

Script started on 2022-10-17 11:06:53+02:00 [COMMAND="kak -n /tmp/aerc-compose-845415736.eml" TERM="foot" TTY="/dev/pts/6" COLUMNS="160" LINES="37"]
[?1049h[?1004h[>4;1m[>5u[?25l=[?2026$p[?1006h[?1000h[?1002h]2;/tmp/aerc-compose-845415736.eml 1:1  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:> Unfortunately, terminal technology is in a similar place to the where HTML and browsers were before HTML5: there's a great number of independently-implemented>> Clearly Kakoune is doing something that confuses Termius, but I've never seen that particular behaviour before and it's hard to guess what the problem might b>> 1. use the `script` tool to run Kakoune and capture all of its output, including escape sequences, to a file:>>         script -c "kak -n" output-log.txt>> 2. When Kakoune appears, verify the output is still glitchy> 3. quit Kakoune with `:q`> 4. `cat output-log.txt` to verify that it more-or-less produces the same result> 5. start bisecting `output-log.txt` to find some escape sequence where up to that point, `cat`ting the file produces reasonable output, but after that point i>> It'll help to recognise the escape sequences Kakoune produces on startup to configure the terminal:>> https://github.com/mawww/kakoune/blob/287217b98715faaddab019f4e17ab54fccaaec70/src/terminal_ui.cc#L1414-L1423>> ...and also [a list of control sequences most terminals understand](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Controls-beginning-with-ESC).  >> Also, since you mention mojibake, make sure that you're using a UTF-8 locale (run the `locale` command and verify each category ends in `.UTF-8` or `.utf8`) b>> -- > Reply to this email directly or view it on GitHub:> https://github.com/mawww/kakoune/issues/4689#issuecomment-1280381424> You are receiving this because you authored the thread.>> Message ID: <mawww/kakoune/issues/4689/1280381424@github.com>~~~~~~~/tmp/aerc-compose-845415736.eml 1:1  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:1  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:> Unfortunately, terminal technology is in a similar place to the where HTML and browsers were before HTML5: there's a great number of independently-implemented>> Clearly Kakoune is doing something that confuses Termius, but I've never seen that particular behaviour before and it's hard to guess what the problem might b>> 1. use the `script` tool to run Kakoune and capture all of its output, including escape sequences, to a file:>>         script -c "kak -n" output-log.txt>> 2. When Kakoune appears, verify the output is still glitchy> 3. quit Kakoune with `:q`> 4. `cat output-log.txt` to verify that it more-or-less produces the same result> 5. start bisecting `output-log.txt` to find some escape sequence where up to that point, `cat`ting the file produces reasonable output, but after that point i>> It'll help to recognise the escape sequences Kakoune produces on startup to configure the terminal:>> https://github.com/mawww/kakoune/blob/287217b98715faaddab019f4e17ab54fccaaec70/src/terminal_ui.cc#L1414-L1423>> ...and also [a list of control sequences most terminals understand](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Controls-beginning-with-ESC).  >> Also, since you mention mojibake, make sure that you're using a UTF-8 locale (run the `locale` command and verify each category ends in `.UTF-8` or `.utf8`) b>> -- > Reply to this email directly or view it on GitHub:> https://github.com/mawww/kakoune/issues/4689#issuecomment-1280381424> You are receiving this because you authored the thread.>> Message ID: <mawww/kakoune/issues/4689/1280381424@github.com>~~~~~~~/tmp/aerc-compose-845415736.eml 1:1  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:2  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-845415736.eml 1:2  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:3  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-845415736.eml 1:3  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:4  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-845415736.eml 1:4  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:5  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-845415736.eml 1:5  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:6  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-845415736.eml 1:6  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:7  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-845415736.eml 1:7  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:8  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-845415736.eml 1:8  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:9  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-845415736.eml 1:9  1 sel - client0@[16680]]2;/tmp/aerc-compose-845415736.eml 1:10  1 sel - client0@[16680] - KakouneOn Mon Oct 17, 2022 at 9:01 AM CEST, Screwtapello wrote:/tmp/aerc-compose-845415736.eml 1:10  1 sel - client0@[16680]
stacyharper commented 1 year ago

I'm trying to dissect all of this (with another mail content). It looks like this exact terminal code is exactly what we expect from kakoune:

[?1049h[?1004h[>4;1m[>5u[?25l=[?2026$p[?1006h[?1000h[?1002h]2;/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:> Can be closed according to this comment https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-895548023>> -- > Reply to this email directly or view it on GitHub:> https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-1279780732> You are receiving this because you are subscribed to this thread.>> Message ID: <pixelfed/pixelfed/issues/2224/1279780732@github.com>~~~~~~~~~~~~~~~~~~~~~~~~~~/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:> Can be closed according to this comment https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-895548023>> -- > Reply to this email directly or view it on GitHub:> https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-1279780732> You are receiving this because you are subscribed to this thread.>> Message ID: <pixelfed/pixelfed/issues/2224/1279780732@github.com>~~~~~~~~~~~~~~~~~~~~~~~~~~/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:2  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:2  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:3  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:3  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:4  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:4  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:5  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:5  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:6  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:6  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:7  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:7  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:8  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:8  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:9  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:9  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:10  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:10  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:11  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:11  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:12  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:12  1 sel - client0@[13450]

I stripped everything until my : char to :wq (that show the auto-completion popup and clippy etc).

Cating this give exactly what we want so I dont really know what to do next o_O

screenshot of the mail rendered in a term

stacyharper commented 1 year ago

I think I bisected the script. Here two typescripts. The first one works great and show the cursor as:

screenshot working

[?1049h[?1004h[>4;1m[>5u[?25l=[?2026$p[?1006h[?1000h[?1002h]2;/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:> Can be closed according to this comment https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-895548023>> -- > Reply to this email directly or view it on GitHub:> https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-1279780732> You are receiving this because you are subscribed to this thread.>> Message ID: <pixelfed/pixelfed/issues/2224/1279780732@github.com>~~~~~~~~~~~~~~~~~~~~~~~~~~/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:> Can be closed according to this comment https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-895548023>> -- > Reply to this email directly or view it on GitHub:> https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-1279780732> You are receiving this because you are subscribed to this thread.>> Message ID: <pixelfed/pixelfed/issues/2224/1279780732@github.com>~~~~~~~~~~~~~~~~~~~~~~~~~~/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:2  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:2  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:3  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:3  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:4  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:4  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:5  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:5  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:6  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:6  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:7  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:7  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:8  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:8  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:9  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:9  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:10  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:10  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:11  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:11  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:12  1 sel - client0@[13450] - Kakoune

The second is one highlight char next (1) and is broken:

screenshot broken

[?1049h[?1004h[>4;1m[>5u[?25l=[?2026$p[?1006h[?1000h[?1002h]2;/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:> Can be closed according to this comment https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-895548023>> -- > Reply to this email directly or view it on GitHub:> https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-1279780732> You are receiving this because you are subscribed to this thread.>> Message ID: <pixelfed/pixelfed/issues/2224/1279780732@github.com>~~~~~~~~~~~~~~~~~~~~~~~~~~/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:> Can be closed according to this comment https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-895548023>> -- > Reply to this email directly or view it on GitHub:> https://github.com/pixelfed/pixelfed/issues/2224#issuecomment-1279780732> You are receiving this because you are subscribed to this thread.>> Message ID: <pixelfed/pixelfed/issues/2224/1279780732@github.com>~~~~~~~~~~~~~~~~~~~~~~~~~~/tmp/aerc-compose-4230040883.eml 1:1  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:2  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:2  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:3  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:3  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:4  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:4  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:5  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:5  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:6  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:6  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:7  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:7  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:8  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:8  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:9  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:9  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:10  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:10  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:11  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:11  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:12  1 sel - client0@[13450] - KakouneOn Sat Oct 15, 2022 at 6:44 PM CEST, MrAn0nym wrote:/tmp/aerc-compose-4230040883.eml 1:12  1 sel - client0@[13450]]2;/tmp/aerc-compose-4230040883.eml 1:12  prompt - client0@[13450] - Kakoune

The diff is this last instruction. What is wrong with it ?

^G^[[1H^[[39mOn Sat Oct ^[[30;47m1^[[39;49m5, 2022 at 6:44 PM CEST, MrAn0nym wrote:^[[K^[[37H^[[36m^[[K^[[98C/tmp/aerc-compose-4230040883.eml 1:12  ^[[34m1 sel^[[36m - client0@[13450]^[[1;12H^[]2;/tmp/aerc-compose-4230040883.eml 1:12  prompt - client0@[13450] - Kakoune
Screwtapello commented 1 year ago

That's not just one instruction, but several. Breaking it down:

None of that looks very suspicious to me, so I don't think the probelem is there.

Looking at your screenshots, though, it looks like there's a bunch of extra text that doesn't appear to be related to what Kakoune (or aerc) are drawing. There's some blanks in the line of ~s down the left-hand edge, the text ga0@l near the bottom, and something about akouneget_string:. There's no get_string function in the Kakoune codebase; is it possible there's some other app or tool running in the background and writing warnings to the terminal Kakoune is running in?

Screwtapello commented 1 year ago

Also, at this point I'm fairly sure the problem @0x5424 is seeing is unrelated. These same diagnosis steps might help figure out what the problem is, but if it's a problem with Kakoune, it should probably be filed as a separate issue.

stacyharper commented 1 year ago

None of that looks very suspicious to me, so I don't think the probelem is there.

I also didnt figured out what is wrong with this instruction. But it is the only difference between the two screenshot results. I tested those two scripts using a fake editor as aerc editor. This fake editor only output the typescripts and sleep for some time for me to inspect the result in aerc. There is no Kakouneget_string in the typescripts and I dont think this is something from aerc itself. So I'm very confused also…

stacyharper commented 1 year ago

Here a reproduction script. Configure it as aerc editor and try to reply to a mail.

https://paste.sr.ht/~stacyharper/f7607bcad81b9380666162bfcd3ba53e57705a45

stacyharper commented 1 year ago

Is it possible something is wrong in those typescripts ? May we be writing outside the box ? Or maybe go-libvterm got a problem. I think the get_string comes from here

Screwtapello commented 1 year ago

It's quite possible go-libvterm has a problem, terminal emulation has a lot of details and corner-cases. I don't know much about aerc or Go, but it looks like the latest version of aerc uses a library called tcell-term instead? Hopefully that behaves a little more reliably.

stacyharper commented 1 year ago

Ya I was discussing with aerc folks on irc and they told me they switched this library. I builded aerc master and the issue seems gone. I'll see after some time if some corner cases remains. I'll comment or close this issue accordingly !