Asciinema: WIndows

Created on 17 Feb 2020  ·  3Comments  ·  Source: asciinema/asciinema

Now before you just close this issue, I do undertand why you did not want to support windows terminals. However the new OFFICAL Terminal from windows is goint to have a proper PTY support. So implementing this in windows should be possible.

Most helpful comment

I installed in Windows cmd via pip, but got the following errors. I think the key problem is No module named 'fcntl', Could we replace it with a multi platform OS support library.

D:\Downloads>pip install asciinema
Collecting asciinema
  Downloading https://files.pythonhosted.org/packages/a7/71/771c859795e02c71c187546f34f7535487b97425bc1dad1e5f6ad2651357/asciinema-2.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\LIUD~1.H\AppData\Local\Temp\pip-install-yb29pspy\asciinema\setup.py", line 1, in <module>
        import asciinema
      File "C:\Users\LIUD~1.H\AppData\Local\Temp\pip-install-yb29pspy\asciinema\asciinema\__init__.py", line 15, in <module>
        import asciinema.pty as pty
      File "C:\Users\LIUD~1.H\AppData\Local\Temp\pip-install-yb29pspy\asciinema\asciinema\pty.py", line 3, in <module>          import fcntl
    ModuleNotFoundError: No module named 'fcntl'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\LIUD~1.H\AppData\Local\Temp\pip-install-yb29pspy\asciinema\

D:\Downloads>

reference:

All 3 comments

I installed in Windows cmd via pip, but got the following errors. I think the key problem is No module named 'fcntl', Could we replace it with a multi platform OS support library.

D:\Downloads>pip install asciinema
Collecting asciinema
  Downloading https://files.pythonhosted.org/packages/a7/71/771c859795e02c71c187546f34f7535487b97425bc1dad1e5f6ad2651357/asciinema-2.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\LIUD~1.H\AppData\Local\Temp\pip-install-yb29pspy\asciinema\setup.py", line 1, in <module>
        import asciinema
      File "C:\Users\LIUD~1.H\AppData\Local\Temp\pip-install-yb29pspy\asciinema\asciinema\__init__.py", line 15, in <module>
        import asciinema.pty as pty
      File "C:\Users\LIUD~1.H\AppData\Local\Temp\pip-install-yb29pspy\asciinema\asciinema\pty.py", line 3, in <module>          import fcntl
    ModuleNotFoundError: No module named 'fcntl'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\LIUD~1.H\AppData\Local\Temp\pip-install-yb29pspy\asciinema\

D:\Downloads>

reference:

I think currently fcntl is one (the only?) roadblock for getting asciinema to run on your mentioned OS.

Searching for fcntl I found two places in the source code where it is used:

https://github.com/asciinema/asciinema/blob/c94e898ec14c35db294974d4c3370fb154eba298/asciinema/pty.py#L36-L43
and
https://github.com/asciinema/asciinema/blob/c94e898ec14c35db294974d4c3370fb154eba298/asciinema/pty.py#L150-L153

At line 36 it is just used to get the terminal window size, if it's not possible it uses the 24x80 dimension. This buffer size is set in line 43. I think this operations should be supported by the alternate PTY and could easily replaced.

The more serious part lies in line 150. There the piping gets set to NonBlock mode. But according to this post on stackoverflow there is a workaround: https://stackoverflow.com/q/34504970.

Maybe somebody is willing to try?

I would love windows support!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karelbilek picture karelbilek  ·  9Comments

laughedelic picture laughedelic  ·  7Comments

lebinh picture lebinh  ·  3Comments

deeplook picture deeplook  ·  10Comments

yuvalif picture yuvalif  ·  10Comments