Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support? #150

Closed
rberteig opened this issue Mar 3, 2016 · 31 comments
Closed

Windows support? #150

rberteig opened this issue Mar 3, 2016 · 31 comments

Comments

@rberteig
Copy link

rberteig commented Mar 3, 2016

A Windows console is a (quirky) ANSI terminal, bound up behind the Windows Console API. Assuming a recorder can be made, the existing asciicast file format should be capable of representing nearly anything a Windows Console application can do. The resulting recording should be as playable as any other.

The difficult trick is the recording. Has anyone put any thought or effort into building such a recorder for a Windows console?

Would a port of asciinema to Windows be possible?

@ku1ik
Copy link
Contributor

ku1ik commented Mar 3, 2016

asciinema records raw stdout output of a child process (shell by default). It doesn't "capture" the screen contents in any way. It captures what gets printed (including all escape/control sequences) and it does that using pseudo-terminal (pty).

So far I didn't find any Windows terminal supporting pty but recently I stumbled upon http://babun.github.io . The page says: Mintty is the console used in babun.

Mintty page (https://mintty.github.io) says: Similarly to other Cygwin/MSYS terminals based on pseudo terminal ("pty") devices (...), however there's a long discussion thread about related issue: mintty/mintty#56

If someone finds a way to use pty on Windows (or something faking pty but giving us raw stdout stream) then we could approach asciinema-on-windows.

@mattn
Copy link

mattn commented Mar 14, 2016

Are you interesting in native cmd support?

https://asciinema.org/a/0nsiofsbhypumh6vy5jx6wuog

But currently experimental.

@ku1ik
Copy link
Contributor

ku1ik commented Mar 14, 2016

@mattn whoa! Sure, I'm curious to hear how this was achieved.

@ku1ik
Copy link
Contributor

ku1ik commented May 20, 2016

For anyone interested in recording on Windows, @mattn has an experimental branch here: https://github.com/mattn/asciinema/tree/windows

@jromero2k
Copy link

Hi! Perhaps this project is useful? https://github.com/adoxa/ansicon

@andkirby
Copy link

andkirby commented Nov 29, 2016

Guys, can I use this tool in git bash for Windows?
I.e. in MinGW. Or in Babun...

I just installed fork from https://github.com/mattn/asciinema/tree/windows but it runs cmd.exe.

@ku1ik
Copy link
Contributor

ku1ik commented Nov 29, 2016

@andkirby I heard it worked in bash under Windows but haven't tried myself.

@andkirby
Copy link

Rumors... :) Thanks.)

@ku1ik ku1ik closed this as completed Dec 29, 2016
@masaeedu
Copy link

masaeedu commented May 4, 2017

@sickill Was this closed because it's merged or because you don't plan to support it?

@ku1ik
Copy link
Contributor

ku1ik commented May 4, 2017

@masaeedu Thanks for your interest.

I don't plan to support Windows because:

  • most pty-like solutions for Windows are hacks
  • I don't use Windows and as a main asciinema developer I don't want to maintain it

At the moment I believe it's not worth it.

@ku1ik
Copy link
Contributor

ku1ik commented Jun 3, 2017

asciinema installs and works perfectly fine under Win10 (WSL): https://asciinema.org/a/123255

@be5invis
Copy link

Recording Windows terminals really need hacks, AFAIK they still support to write to the console buffer directly with MOV instructions. @miniksa

@andkirby
Copy link

At the moment I believe it's not worth it.

I guess, it worth it. I really would love to have it the pocket to make some video in Git Bash for Windows.

I just have lots of stuff to show. :)

@ku1ik
Copy link
Contributor

ku1ik commented Oct 24, 2017

@andkirby #150 (comment)

@tajmone
Copy link

tajmone commented Oct 28, 2017

I'm following with intrest the thread on this Issue. I hope that in the future a solution might come up for supporting use of Asciinema on Window's CMD, PowerShell and Git Bash (without WSL).

In the meantime I'm dropping a few links to resources I've found that might help in that direction:

winpty

winpty is a Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs. The package consists of a library (libwinpty) and a tool for Cygwin and MSYS for running Windows console programs in a Cygwin/MSYS pty.

NOTE: winpty is used by the node-pty library below.

node-pty

forkpty(3) bindings for node.js. This allows you to fork processes with pseudoterminal file descriptors. It returns a terminal object which allows reads and writes.

This is useful for:

  • Writing a terminal emulator (eg. via xterm.js).
  • Getting certain programs to think you're a terminal, such as when you need a program to send you control sequences.

node-pty supports Linux, macOS and Windows. Windows support is possible by utilizing the winpty library.

@ku1ik
Copy link
Contributor

ku1ik commented Oct 28, 2017

@tajmone thanks for the summary of the possible options. I don't think we'll be able to use node-pty though, as asciinema is written in Python.

I'm not very much familiar with WSL - is this part of Win10, or this needs to be installed separately?

@tajmone
Copy link

tajmone commented Oct 28, 2017

I'm not very much familiar with WSL - is this part of Win10, or this needs to be installed separately?

Me neither ... but from what I read, WSL can be optionally installed in Win 10, and it will then install parts from an actual Ubuntu distro. Since I already have Git Bash for Windows, which offer me all I need right now, I'd rather not install it until I know a bit more about it — WSL surely offers more tools than just Git Bash, and has a broader scope; but I guess it also takes up more space.

@fquinner
Copy link

@tajmone @andkirby A little late, but you can set different shells with Matt's fork using COMSPEC=cmd, COMSPEC=bash or COMSPEC=powershell. IMHO, COMSPEC would be the right windows variable to set for this sort of function. Example outputs below:

Cmd:
https://asciinema.org/a/r0UNULw8K5r0HV35kTLOatAbX

WSL Bash (launched from within standard terminal):
https://asciinema.org/a/XtLu8rh65uFekim1VbWamNcmh

Powershell:
https://asciinema.org/a/HttJNKCwM9Tb1NlVP5PFy6Ftx

Personally I think it works jolly well...

@tajmone
Copy link

tajmone commented Nov 21, 2017

Thanks a lot @fquinner ! I've read here and there about Matt's fork but didn't realize it had reached such an operative status. The links you provided clarified the situation.

I'll defiinitely look into it!

@raghavpuri31
Copy link

So asciinema, didn't run on Windows cmd, right?

@joelhandwell
Copy link

joelhandwell commented Jan 31, 2018

One other option is to open issue in https://github.com/Microsoft/console to add pty compatible API to cmd. Microsoft Windows Console engineering team such as @bitcrazed is on Github to listen to you.

@bitcrazed
Copy link

What @joelhandwell said :) Thanks for suggesting this Joe, and look forward to hearing from y'all on the repo above ;)

giphy

@joelhandwell
Copy link

joelhandwell commented Feb 1, 2018

@bitcrazed I went ahead and try to make an issue but already @be5invis submitted microsoft/terminal#57 ! People in this issue hopefully give a lot of 👍 to the issue and catch more Microsoft attention.

@mattn
Copy link

mattn commented Feb 2, 2018

If you don't want workaround or hacks, go-winpty can be used for this.

https://github.com/iamacarpet/go-winpty

@Kristinita
Copy link

https://asciinema.org/a/r0UNULw8K5r0HV35kTLOatAbX

https://asciinema.org/a/HttJNKCwM9Tb1NlVP5PFy6Ftx

@fquinner, I'm sorry, could you write in detail, how you record these videos?

I try install and run @mattn fork on Windows, but I don't understand, how I can fix No module named 'termios' error.

Thanks.

@mattn
Copy link

mattn commented Mar 22, 2018

Try to build like below:

mkdir \path\to\your\gopath\src\github.com\mattn
cd \path\to\your\gopath\src\github.com\mattn
git clone https://github.com/mattn/asciinema
cd asciinema
git checkout windows
go build

@Kristinita
Copy link

@mattn ,

D:\>go version
go version go1.10 windows/amd64

D:\>go get -d github.com/mattn/asciinema
package github.com/asciinema/asciinema/Godeps/_workspace/src/github.com/docopt/docopt-go: cannot find package "github.com/asciinema/asciinema/Godeps/_workspace/src/github.com/docopt/docopt-go" in any of:
        C:\tools\go\src\github.com\asciinema\asciinema\Godeps\_workspace\src\github.com\docopt\docopt-go (from $GOROOT)
        C:\Users\SashaChernykh\go\src\github.com\asciinema\asciinema\Godeps\_workspace\src\github.com\docopt\docopt-go (from $GOPATH)
package github.com/asciinema/asciinema/api: cannot find package "github.com/asciinema/asciinema/api" in any of:
        C:\tools\go\src\github.com\asciinema\asciinema\api (from $GOROOT)
        C:\Users\SashaChernykh\go\src\github.com\asciinema\asciinema\api (from $GOPATH)
package github.com/asciinema/asciinema/commands: cannot find package "github.com/asciinema/asciinema/commands" in any of:
        C:\tools\go\src\github.com\asciinema\asciinema\commands (from $GOROOT)
        C:\Users\SashaChernykh\go\src\github.com\asciinema\asciinema\commands (from $GOPATH)
package github.com/asciinema/asciinema/util: cannot find package "github.com/asciinema/asciinema/util" in any of:
        C:\tools\go\src\github.com\asciinema\asciinema\util (from $GOROOT)
        C:\Users\SashaChernykh\go\src\github.com\asciinema\asciinema\util (from $GOPATH)

Thanks.

@mattn
Copy link

mattn commented Mar 22, 2018

Sorry, it was my mistake. Please try again as above.

@Kristinita
Copy link

@mattn,

  1. Can you make your version installation more simply? For example, pip install asciinemawindows.
  2. I still can't install your asciinema version (yes, I set gopath):
D:\go\src\github.com\mattn\asciinema>go build
main.go:11:2: cannot find package "github.com/asciinema/asciinema/Godeps/_workspace/src/github.com/docopt/docopt-go" in any of:
        C:\tools\go\src\github.com\asciinema\asciinema\Godeps\_workspace\src\github.com\docopt\docopt-go (from $GOROOT)
        D:\go\src\github.com\asciinema\asciinema\Godeps\_workspace\src\github.com\docopt\docopt-go (from $GOPATH)
main.go:12:2: cannot find package "github.com/asciinema/asciinema/api" in any of:
        C:\tools\go\src\github.com\asciinema\asciinema\api (from $GOROOT)
        D:\go\src\github.com\asciinema\asciinema\api (from $GOPATH)
main.go:13:2: cannot find package "github.com/asciinema/asciinema/commands" in any of:
        C:\tools\go\src\github.com\asciinema\asciinema\commands (from $GOROOT)
        D:\go\src\github.com\asciinema\asciinema\commands (from $GOPATH)
main.go:14:2: cannot find package "github.com/asciinema/asciinema/util" in any of:
        C:\tools\go\src\github.com\asciinema\asciinema\util (from $GOROOT)
        D:\go\src\github.com\asciinema\asciinema\util (from $GOPATH)
main.go:15:2: cannot find package "github.com/mattn/go-colorable" in any of:
        C:\tools\go\src\github.com\mattn\go-colorable (from $GOROOT)
        D:\go\src\github.com\mattn\go-colorable (from $GOPATH)

Thanks.

@ku1ik
Copy link
Contributor

ku1ik commented Mar 31, 2018

Please move discussion about mattn's fork installation issues to mattn's repo. Thanks! ;)

@ku1ik
Copy link
Contributor

ku1ik commented Mar 31, 2018

If you'd like to discuss Windows support in general please use asciinema's discussion forum: https://discourse.asciinema.org/

@asciinema asciinema locked and limited conversation to collaborators Mar 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests