[GH-ISSUE #681] Garbled text when pasting #963

Closed
opened 2026-03-15 11:08:20 +03:00 by kerem · 6 comments
Owner

Originally created by @Cyb3rC3lt on GitHub (May 29, 2025).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/681

Expected behavior
Just paste with no issues

Versions:

  • OS: Kali Linux 2025
  • asciinema cli: asciinema 3.0.0-rc.3

I really really want this to work as it would be super useful for me as a pentester to back up my logs to a Share just in case Kali Linux crashes so I have all my client logs.

It does most of the time but when I paste text it sometimes just screws up the console. I have my Terminator console set to start recording on opening with an initial command as you can see below. But when I copy a piece of text from say Sublime it can mess it up on pasting and the text can jump up a line. Any ideas why this may be the case?

If you want to try and reproduce this is the offending piece of text as an example:

secretsdump.py -ntds /home/david/Tools/test.dit -system /home/david/Tools/SYSTEM LOCAL -outputfile ~/Tests/BS/dit.txt

If I drag the offending pane upwards (or enlarge it left) it seems to fix itself I just noticed but other times I could swear that the added text breaks the command. It seems quite random. It might work 5 times in a row then I open a new tab and it starts breaking.

Here it is working then I open a new pane underneath and although the command works fine you can understand I can't screenshot that for a client as it is all mangled compared to the command at the top. Hopefully you can provide some tips or a potential fix? Thanks

Image

Originally created by @Cyb3rC3lt on GitHub (May 29, 2025). Original GitHub issue: https://github.com/asciinema/asciinema/issues/681 **Expected behavior** Just paste with no issues **Versions:** - OS: Kali Linux 2025 - asciinema cli: asciinema 3.0.0-rc.3 I really really want this to work as it would be super useful for me as a pentester to back up my logs to a Share just in case Kali Linux crashes so I have all my client logs. It does most of the time but when I paste text it sometimes just screws up the console. I have my Terminator console set to start recording on opening with an initial command as you can see below. But when I copy a piece of text from say Sublime it can mess it up on pasting and the text can jump up a line. Any ideas why this may be the case? If you want to try and reproduce this is the offending piece of text as an example: secretsdump.py -ntds /home/david/Tools/test.dit -system /home/david/Tools/SYSTEM LOCAL -outputfile ~/Tests/BS/dit.txt If I drag the offending pane upwards (or enlarge it left) it seems to fix itself I just noticed but other times I could swear that the added text breaks the command. It seems quite random. It might work 5 times in a row then I open a new tab and it starts breaking. Here it is working then I open a new pane underneath and although the command works fine you can understand I can't screenshot that for a client as it is all mangled compared to the command at the top. Hopefully you can provide some tips or a potential fix? Thanks ![Image](https://github.com/user-attachments/assets/d965b9ea-54b6-420c-9084-9ceecb9c9030)
kerem closed this issue 2026-03-15 11:08:25 +03:00
Author
Owner

@ku1ik commented on GitHub (May 29, 2025):

Can you try with 3.0.0-rc.4? There were many bugfixes since rc.3 so there's a chance this is not longer an issue 🤞

<!-- gh-comment-id:2919475581 --> @ku1ik commented on GitHub (May 29, 2025): Can you try with 3.0.0-rc.4? There were many bugfixes since rc.3 so there's a chance this is not longer an issue 🤞
Author
Owner

@Cyb3rC3lt commented on GitHub (May 30, 2025):

Really thought that might solve it but no joy. Seems to be when you move further down the screen or something. Here it is failing on the 5th pane down and then when I move to a new tab it happened on the first one.

Its kinda like it builds up a gap slowly and the child panes inherit the gap and it increases until it breaks but I could be talking rubbish as I have no idea how it works to be honest.

Breaking on 5th attempt
Image

Breaking in new tab:
Image

<!-- gh-comment-id:2921492625 --> @Cyb3rC3lt commented on GitHub (May 30, 2025): Really thought that might solve it but no joy. Seems to be when you move further down the screen or something. Here it is failing on the 5th pane down and then when I move to a new tab it happened on the first one. Its kinda like it builds up a gap slowly and the child panes inherit the gap and it increases until it breaks but I could be talking rubbish as I have no idea how it works to be honest. Breaking on 5th attempt ![Image](https://github.com/user-attachments/assets/ca766fa0-f40b-4538-8e2a-764affc12dce) Breaking in new tab: ![Image](https://github.com/user-attachments/assets/d90ab79d-f60f-4305-b067-554f8b82e9dd)
Author
Owner

@ku1ik commented on GitHub (Jun 1, 2025):

I tried to reproduce on my side but no luck. If you can answer the following question it may help us to close in on the bug:

  1. what shell (and version) do you use?
  2. what is the terminator version?
  3. does this problem occur when you manually start asciinema rec instead of automatically running it via initial command?
  4. does this problem occur if you use script command for recording instead of asciinema for the initial command?
<!-- gh-comment-id:2926722037 --> @ku1ik commented on GitHub (Jun 1, 2025): I tried to reproduce on my side but no luck. If you can answer the following question it may help us to close in on the bug: 1. what shell (and version) do you use? 2. what is the terminator version? 3. does this problem occur when you manually start `asciinema rec` instead of automatically running it via initial command? 4. does this problem occur if you use `script` command for recording instead of asciinema for the initial command?
Author
Owner

@Cyb3rC3lt commented on GitHub (Jun 3, 2025):

Here are the answers:

  1. zsh 5.9 (x86_64-debian-linux-gnu)
  2. terminator 2.1.4
  3. Just tried this and by not adding it into the Terminator gui it may have helped. I have now added it into zsh instead to see if that will get around it.
  4. Haven't tried this but the results of point 3 seem promising.

Given point 3 seems to be a workaround I will try this over the coming days and will report back. It could have solved it. Thanks for the tips.

<!-- gh-comment-id:2936069890 --> @Cyb3rC3lt commented on GitHub (Jun 3, 2025): Here are the answers: 1. zsh 5.9 (x86_64-debian-linux-gnu) 2. terminator 2.1.4 3. Just tried this and by not adding it into the Terminator gui it may have helped. I have now added it into zsh instead to see if that will get around it. 4. Haven't tried this but the results of point 3 seem promising. Given point 3 seems to be a workaround I will try this over the coming days and will report back. It could have solved it. Thanks for the tips.
Author
Owner

@Cyb3rC3lt commented on GitHub (Jun 4, 2025):

I think I can fix the garbled text issue. Starting it automatically not via the gui but via zshrc with this seems to make a difference:

Auto-start asciinema recording and save to /mnt/hgfs/ConsoleLogs and auto-start asciinema recording if not already started in this shell
if -z "$ASCIINEMA_RECORDING_STARTED" && -t 1 ; then
export ASCIINEMA_RECORDING_STARTED=1
asciinema rec -i 0.001 --command="zsh" /mnt/hgfs/ConsoleLogs/$(date +%H-%M-%S_"%d-%m-%Y").cast
exit
fi

Before I go can I ask another question. I ssh to a lot of servers whilst testing and when I unpause a VM it will say rightfully my connection is broken to the ssh server that I may have left open before pausing it. So I get this in my console as expected:

Image

And this from ascii

Image

Are there any workarounds to keep it recording the same shell after the disconnection as it dies at that point when I replay it?

I also would like to replay my whole recording instantly like this, let me know if I can do it a better way please?

asciinema play -i 0.00000000001 /mnt/hgfs/ConsoleLogs/09-31-16_04-06-2025.cast

Thanks

<!-- gh-comment-id:2941209783 --> @Cyb3rC3lt commented on GitHub (Jun 4, 2025): I think I can fix the garbled text issue. Starting it automatically not via the gui but via zshrc with this seems to make a difference: Auto-start asciinema recording and save to /mnt/hgfs/ConsoleLogs and auto-start asciinema recording if not already started in this shell if [[ -z "$ASCIINEMA_RECORDING_STARTED" && -t 1 ]]; then export ASCIINEMA_RECORDING_STARTED=1 asciinema rec -i 0.001 --command="zsh" /mnt/hgfs/ConsoleLogs/$(date +%H-%M-%S_"%d-%m-%Y").cast exit fi Before I go can I ask another question. I ssh to a lot of servers whilst testing and when I unpause a VM it will say rightfully my connection is broken to the ssh server that I may have left open before pausing it. So I get this in my console as expected: ![Image](https://github.com/user-attachments/assets/fed98dd2-28ed-4d56-bfc4-6b73cfc2fb7f) And this from ascii ![Image](https://github.com/user-attachments/assets/a576b664-22db-4fb5-8e65-21175813366f) Are there any workarounds to keep it recording the same shell after the disconnection as it dies at that point when I replay it? I also would like to replay my whole recording instantly like this, let me know if I can do it a better way please? `asciinema play -i 0.00000000001 /mnt/hgfs/ConsoleLogs/09-31-16_04-06-2025.cast` Thanks
Author
Owner

@Cyb3rC3lt commented on GitHub (Jun 6, 2025):

I will close this issue as the original one is fixed. Ssh connectivity can be another topic if needs be. Thanks for the help

<!-- gh-comment-id:2949137380 --> @Cyb3rC3lt commented on GitHub (Jun 6, 2025): I will close this issue as the original one is fixed. Ssh connectivity can be another topic if needs be. Thanks for the help
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#963
No description provided.