[GH-ISSUE #192] Strange escape characters recording ptpython #755

Closed
opened 2026-03-15 10:10:58 +03:00 by kerem · 1 comment
Owner

Originally created by @tiagocoutinho on GitHub (Feb 19, 2017).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/192

I use asciinema to record a ptpython console.
The recorded video shows what I assume are strange escape characters in each ptpython prompt.
I attach a simple record showing the problem issue-ptpython.json.zip.
Here is what I used in the command line:
$ asciinema rec -c "ptpython" -w 0.25 -t "Issue with ptpython" issue-ptpython.json

To view the problem simply download the attached file and do
$ asciinema play issue-ptpython.json

I am using:

  • linux mint 18
  • CPython 3.6.0 (default, Feb 4 2017, 14:24:34) [GCC 5.4.0 20160609]
  • asciinema 1.3.0
  • ptpython 0.35
  • prompt_toolkit 1.0.13
Originally created by @tiagocoutinho on GitHub (Feb 19, 2017). Original GitHub issue: https://github.com/asciinema/asciinema/issues/192 I use asciinema to record a [ptpython](https://github.com/jonathanslenders/ptpython) console. The recorded video shows what I assume are strange escape characters in each ptpython prompt. I attach a simple record showing the problem [issue-ptpython.json.zip](https://github.com/asciinema/asciinema/files/785619/issue-ptpython.json.zip). Here is what I used in the command line: `$ asciinema rec -c "ptpython" -w 0.25 -t "Issue with ptpython" issue-ptpython.json` To view the problem simply download the attached file and do `$ asciinema play issue-ptpython.json` I am using: * linux mint 18 * CPython 3.6.0 (default, Feb 4 2017, 14:24:34) [GCC 5.4.0 20160609] * asciinema 1.3.0 * [ptpython](https://github.com/jonathanslenders/ptpython) 0.35 * [prompt_toolkit](https://github.com/jonathanslenders/python-prompt-toolkit) 1.0.13
kerem closed this issue 2026-03-15 10:11:03 +03:00
Author
Owner

@cassdeckard commented on GitHub (Mar 24, 2017):

I've duplicated this on OSX and confirmed it's a duplicate of #108
When following the steps to duplicate, if you look in the issue-ptpython.json file that is generated, it contains two CSI 6 n (CPR) control sequences that are causing the terminal to respond with an escape sequence encoding the cursor position.

@tiagocoutinho, as a workaround you should be able to use the fix-asciicastscript in this gist to fix your offending JSON files. I used it on the JSON file I reproduced the issue with and found that it fixed the issue.

<!-- gh-comment-id:289061010 --> @cassdeckard commented on GitHub (Mar 24, 2017): I've duplicated this on OSX and confirmed it's a duplicate of #108 When following the steps to duplicate, if you look in the `issue-ptpython.json` file that is generated, it contains two `CSI 6 n` (CPR) control sequences that are causing the terminal to respond with an escape sequence encoding the cursor position. @tiagocoutinho, as a workaround you should be able to use the `fix-asciicast`script in [this gist](https://gist.github.com/mattdeckard/246edaa833191f69862a8591498e09c2) to fix your offending JSON files. I used it on the JSON file I reproduced the issue with and found that it fixed the 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#755
No description provided.