[GH-ISSUE #688] asciinema stream + ZSH with OMZ within tmux session shows additional characters #965

Closed
opened 2026-03-15 11:09:36 +03:00 by kerem · 10 comments
Owner

Originally created by @moritzdietz on GitHub (Jul 2, 2025).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/688

Pre-submission checks

  • I have searched existing issues and this bug has not been reported yet
  • This is a bug report for asciinema CLI (not player or server)

Bug Description

If you have ZSH as your shell and install OMZ (no additional plugins needed to reproduce) and then run asciinema stream the player shows additional strings in the browser which are not rended inside of the terminal.

In the background is the player and the foreground the terminal where I started asciinema.

Image

This was already discussed in the Matrix chat room: https://matrix.to/#/!fTVjfZsxcITbVFJxLq:matrix.org/$TRVG3a70wYEu-ptNIU_aSvgGI9XYITl5EJjI3-2IfEw?via=matrix.org&via=moritzdietz.com&via=jauriarts.org

Steps to Reproduce

  1. Have ZSH be your shell
  2. Install OMZ – no OMZ plugins needed or further configuration
  3. Install the latest asciinema RC
  4. Install tmux (no specific version) and start a session
  5. Run asciinema stream -l inside the tmux session and open the browser
  6. run pwd and check the output in the player

Expected Behavior

No additional characters or strings should be present in the player

Operating System

macOS 15.5

asciinema CLI Version

3.0.0-rc.5

Installation Method

Built from source

Terminal Information

Ghostty d0e14529 build 10613
zsh 5.9 (arm64-apple-darwin24.0)
tmux next-3.6

Additional Context

No response

Originally created by @moritzdietz on GitHub (Jul 2, 2025). Original GitHub issue: https://github.com/asciinema/asciinema/issues/688 ### Pre-submission checks - [x] I have searched existing issues and this bug has not been reported yet - [x] This is a bug report for asciinema CLI (not player or server) ### Bug Description If you have ZSH as your shell and install OMZ (no additional plugins needed to reproduce) and then run `asciinema stream` the player shows additional strings in the browser which are not rended inside of the terminal. In the background is the player and the foreground the terminal where I started asciinema. <img width="912" alt="Image" src="https://github.com/user-attachments/assets/9d8c6ef4-666a-4e85-8499-355e3b1116b5" /> This was already discussed in the Matrix chat room: https://matrix.to/#/!fTVjfZsxcITbVFJxLq:matrix.org/$TRVG3a70wYEu-ptNIU_aSvgGI9XYITl5EJjI3-2IfEw?via=matrix.org&via=moritzdietz.com&via=jauriarts.org ### Steps to Reproduce 1. Have ZSH be your shell 2. Install OMZ – no OMZ plugins needed or further configuration 3. Install the latest asciinema RC 4. Install tmux (no specific version) and start a session 5. Run `asciinema stream -l` inside the tmux session and open the browser 6. run `pwd` and check the output in the player ### Expected Behavior No additional characters or strings should be present in the player ### Operating System macOS 15.5 ### asciinema CLI Version 3.0.0-rc.5 ### Installation Method Built from source ### Terminal Information Ghostty d0e14529 build 10613 zsh 5.9 (arm64-apple-darwin24.0) tmux next-3.6 ### Additional Context _No response_
kerem closed this issue 2026-03-15 11:09:42 +03:00
Author
Owner

@fspv commented on GitHub (Jul 19, 2025):

running into a similar issue

Image

I'm also seeing these errors in the log when rendering, not sure if it is related

$ agg -v --renderer resvg --font-family "JetBrainsMonoNL Nerd Font,JetBrainsMonoNL NF" demo.cast 1.gif
[INFO  agg] terminal size: 75x33
[INFO  agg] selected font families: ["JetBrainsMonoNL Nerd Font", "JetBrainsMonoNL Nerd Font", "DejaVu Sans"]
[INFO  agg] selected theme: dracula
[INFO  agg] gif dimensions: 646x666
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to DejaVu Sans Mono.
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
3 / 25 [==============>----------------------------------------------------------------------------------------------------------] 12.00 % 29.72/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
4 / 25 [===================>-----------------------------------------------------------------------------------------------------] 16.00 % 29.41/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
5 / 25 [========================>------------------------------------------------------------------------------------------------] 20.00 % 26.29/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
6 / 25 [=============================>-------------------------------------------------------------------------------------------] 24.00 % 24.25/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
7 / 25 [=================================>---------------------------------------------------------------------------------------] 28.00 % 22.64/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
8 / 25 [======================================>----------------------------------------------------------------------------------] 32.00 % 22.34/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
9 / 25 [===========================================>-----------------------------------------------------------------------------] 36.00 % 23.44/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
10 / 25 [===============================================>------------------------------------------------------------------------] 40.00 % 24.38/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
11 / 25 [====================================================>-------------------------------------------------------------------] 44.00 % 25.22/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to DejaVu Sans Mono.
12 / 25 [=========================================================>--------------------------------------------------------------] 48.00 % 25.43/s 1s
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
13 / 25 [==============================================================>---------------------------------------------------------] 52.00 % 26.25/s 0s
[WARN  usvg::text::layout] No fonts with a ⎿/U+23BF character were found.
[WARN  usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono.
<!-- gh-comment-id:3092475005 --> @fspv commented on GitHub (Jul 19, 2025): running into a similar issue <img width="818" height="842" alt="Image" src="https://github.com/user-attachments/assets/4b1dc7be-acdc-40a5-b716-f709b04cdc02" /> I'm also seeing these errors in the log when rendering, not sure if it is related ``` $ agg -v --renderer resvg --font-family "JetBrainsMonoNL Nerd Font,JetBrainsMonoNL NF" demo.cast 1.gif [INFO agg] terminal size: 75x33 [INFO agg] selected font families: ["JetBrainsMonoNL Nerd Font", "JetBrainsMonoNL Nerd Font", "DejaVu Sans"] [INFO agg] selected theme: dracula [INFO agg] gif dimensions: 646x666 [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to DejaVu Sans Mono. [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 3 / 25 [==============>----------------------------------------------------------------------------------------------------------] 12.00 % 29.72/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 4 / 25 [===================>-----------------------------------------------------------------------------------------------------] 16.00 % 29.41/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 5 / 25 [========================>------------------------------------------------------------------------------------------------] 20.00 % 26.29/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 6 / 25 [=============================>-------------------------------------------------------------------------------------------] 24.00 % 24.25/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 7 / 25 [=================================>---------------------------------------------------------------------------------------] 28.00 % 22.64/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 8 / 25 [======================================>----------------------------------------------------------------------------------] 32.00 % 22.34/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 9 / 25 [===========================================>-----------------------------------------------------------------------------] 36.00 % 23.44/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 10 / 25 [===============================================>------------------------------------------------------------------------] 40.00 % 24.38/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 11 / 25 [====================================================>-------------------------------------------------------------------] 44.00 % 25.22/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to DejaVu Sans Mono. 12 / 25 [=========================================================>--------------------------------------------------------------] 48.00 % 25.43/s 1s [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. 13 / 25 [==============================================================>---------------------------------------------------------] 52.00 % 26.25/s 0s [WARN usvg::text::layout] No fonts with a ⎿/U+23BF character were found. [WARN usvg::text] Fallback from JetBrainsMonoNL Nerd Font to Noto Sans Mono. ```
Author
Owner

@fspv commented on GitHub (Jul 19, 2025):

This seemed to help in my case:

DISABLE_AUTO_TITLE=true asciinema rec demo.cast --overwrite -c zsh

Found it by looking at

which -a $preexec_functions
<!-- gh-comment-id:3092490640 --> @fspv commented on GitHub (Jul 19, 2025): This seemed to help in my case: ```sh DISABLE_AUTO_TITLE=true asciinema rec demo.cast --overwrite -c zsh ``` Found it by looking at ```sh which -a $preexec_functions ```
Author
Owner

@moritzdietz commented on GitHub (Jul 20, 2025):

Huh that is interesting! I tried to reproduce my issue and setting DISABLE_AUTO_TITLE=true like you suggested actually works.
Although I did test it with my initial command again:

Image

This seems to stem from: https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh

<!-- gh-comment-id:3094525625 --> @moritzdietz commented on GitHub (Jul 20, 2025): Huh that is interesting! I tried to reproduce my issue and setting `DISABLE_AUTO_TITLE=true` like you suggested actually works. Although I did test it with my initial command again: <img width="1058" height="372" alt="Image" src="https://github.com/user-attachments/assets/d288eb34-041c-47bb-b985-3301ae9e9f12" /> This seems to stem from: https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh
Author
Owner

@moritzdietz commented on GitHub (Jul 20, 2025):

This seems to stem from: https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh

… which you can "patch" so that OMZ won't run this in case you are recording with asciinema:

--- lib/termsupport.zsh	2025-05-22 20:03:26
+++ custom/lib/termsupport.zsh	2025-07-20 20:46:36
@@ -45,6 +45,11 @@
   ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
 fi

+# skip when recording with asciinema
+if [[ -n "$ASCIINEMA_REC" ]]; then
+  return 0
+fi
+
 # Runs before showing the prompt
 function omz_termsupport_precmd {
   [[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return 0

Which works but I'm unsure if this is the right approach. You can find other skips defined in this file as well for other environments, so it seemed right to just add another one. Although it can be discussed about the correct way.

I'll gladly open up an issue with the OMZ project to discuss it there if we agree that this is the right approach to fix this issue – as this will affect all OMZ users.

<!-- gh-comment-id:3094709056 --> @moritzdietz commented on GitHub (Jul 20, 2025): > This seems to stem from: https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh … which you can "patch" so that OMZ won't run this in case you are recording with asciinema: ```diff --- lib/termsupport.zsh 2025-05-22 20:03:26 +++ custom/lib/termsupport.zsh 2025-07-20 20:46:36 @@ -45,6 +45,11 @@ ZSH_THEME_TERM_TITLE_IDLE="%n@%m" fi +# skip when recording with asciinema +if [[ -n "$ASCIINEMA_REC" ]]; then + return 0 +fi + # Runs before showing the prompt function omz_termsupport_precmd { [[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return 0 ``` Which *works* but I'm unsure if this is the right approach. You can find other skips defined in this file as well for other environments, so it seemed right to just add another one. Although it can be discussed about the correct way. I'll gladly open up an issue with the OMZ project to discuss it there if we agree that this is the right approach to fix this issue – as this will affect all OMZ users.
Author
Owner

@fspv commented on GitHub (Jul 20, 2025):

Not a huge fan of adding such implicit dependencies between unrelated projects. I have solved the issue for myself by just adding DISABLE_AUTO_TITLE to my zshrc. I realized I don't use this functionality anyway.

So up to you, but at the very least we can make debugging this problem easier. So might be worth adding info about which -a $preexec_functions to the FAQ somewhere

<!-- gh-comment-id:3094790294 --> @fspv commented on GitHub (Jul 20, 2025): Not a huge fan of adding such implicit dependencies between unrelated projects. I have solved the issue for myself by just adding `DISABLE_AUTO_TITLE` to my zshrc. I realized I don't use this functionality anyway. So up to you, but at the very least we can make debugging this problem easier. So might be worth adding info about `which -a $preexec_functions` to the FAQ somewhere
Author
Owner

@ku1ik commented on GitHub (Jul 21, 2025):

Good sleuthing guys 👏

So, we know DISABLE_AUTO_TITLE helps, but what's the actual core of the problem here?

Do you see similar problem when replacing asciinema with the script command?

<!-- gh-comment-id:3095998463 --> @ku1ik commented on GitHub (Jul 21, 2025): Good sleuthing guys 👏 So, we know `DISABLE_AUTO_TITLE` helps, but what's the actual core of the problem here? Do you see similar problem when replacing asciinema with the `script` command?
Author
Owner

@moritzdietz commented on GitHub (Jul 23, 2025):

Do you see similar problem when replacing asciinema with the script command?

No
Image
(This is in the same setup as described in the issue text)

So, we know DISABLE_AUTO_TITLE helps, but what's the actual core of the problem here?

To me it seems that the "problem" is that these two lines/logic are being used:

The one being OSC 7 and the other is a xterm escape sequence to set the terminal title which seems to trip up asciinema's terminal emulation?!

Example:

Image
<!-- gh-comment-id:3109058782 --> @moritzdietz commented on GitHub (Jul 23, 2025): > Do you see similar problem when replacing asciinema with the script command? No <img width="652" height="393" alt="Image" src="https://github.com/user-attachments/assets/a6c3c529-ed1f-425e-9354-f54da168c3e0" /> (This is in the same setup as described in the issue text) > So, we know DISABLE_AUTO_TITLE helps, but what's the actual core of the problem here? To me it seems that the "problem" is that these two lines/logic are being used: * https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh#L24-L25 * https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh#L158 The one being OSC 7 and the other is a xterm escape sequence to set the terminal title which seems to trip up asciinema's terminal emulation?! Example: <img width="1425" height="734" alt="Image" src="https://github.com/user-attachments/assets/15b4d85a-549f-49fe-8faa-d193a18bf007" />
Author
Owner

@moritzdietz commented on GitHub (Jan 9, 2026):

@fspv Can you retest please? For me this issue no longer exists. Since the opening of this issue I have updated Ghostty, tmux and obviously other bits. But I really can't reproduce this anymore.

Are you still seeing your problem?

<!-- gh-comment-id:3730239908 --> @moritzdietz commented on GitHub (Jan 9, 2026): @fspv Can you retest please? For me this issue no longer exists. Since the opening of this issue I have updated Ghostty, tmux and obviously other bits. But I really can't reproduce this anymore. Are you still seeing your problem?
Author
Owner

@fspv commented on GitHub (Jan 11, 2026):

Yeah, seems to be fine for me now. Problem doesn't reproduce with 3.0.0-rc.4 from the NixOS repos

<!-- gh-comment-id:3734389030 --> @fspv commented on GitHub (Jan 11, 2026): Yeah, seems to be fine for me now. Problem doesn't reproduce with 3.0.0-rc.4 from the NixOS repos
Author
Owner

@moritzdietz commented on GitHub (Jan 11, 2026):

Oh, that's even more interesting and confirms what we talked about on Matrix as well – there was no changes in asciinema itself which would have tried to solve our reported problem.

The version I just re-tested this with was based 9a3c702. I did however also test with asciinema 3.1.0 with the same positive results.

So it must've been something else – OMZ, zsh, Ghostty or tmux which has since received updates.
With this, I'm going ahead and close this issue 🙂

<!-- gh-comment-id:3734511123 --> @moritzdietz commented on GitHub (Jan 11, 2026): Oh, that's even more interesting and confirms what we talked about on Matrix as well – there was no changes in asciinema itself which would have tried to solve our reported problem. The version I just re-tested this with was based 9a3c702. I did however also test with asciinema 3.1.0 with the same positive results. So it must've been something else – OMZ, zsh, Ghostty or tmux which has since received updates. With this, I'm going ahead and close this issue 🙂
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#965
No description provided.