Windows ์ฝ์์ Windows ์ฝ์ API ๋ค์ ๋ฌถ์ธ (๊ธฐ๋ฐํ) ANSI ํฐ๋ฏธ๋์ ๋๋ค. ๋ ์ฝ๋๋ฅผ ๋ง๋ค ์ ์๋ค๊ณ ๊ฐ์ ํ๋ฉด ๊ธฐ์กด์ asciicast ํ์ผ ํ์์ Windows ์ฝ์ ์์ฉ ํ๋ก๊ทธ๋จ์ด ํ ์ ์๋ ๊ฑฐ์ ๋ชจ๋ ๊ฒ์ ํํํ ์ ์์ด์ผ ํฉ๋๋ค. ๊ฒฐ๊ณผ ๋ น์์ ๋ค๋ฅธ ๋ น์๊ณผ ๋ง์ฐฌ๊ฐ์ง๋ก ์ฌ์ํ ์ ์์ด์ผ ํฉ๋๋ค.
์ด๋ ค์ด ํธ๋ฆญ์ ๋ น์์ ๋๋ค. Windows ์ฝ์์ฉ์ผ๋ก ๊ทธ๋ฌํ ๋ ์ฝ๋๋ฅผ ๊ตฌ์ถํ๊ธฐ ์ํด ์๊ฐ์ด๋ ๋ ธ๋ ฅ์ ๊ธฐ์ธ์ธ ์ฌ๋์ด ์์ต๋๊น?
asciinema๋ฅผ Windows๋ก ์ด์ํ๋ ๊ฒ์ด ๊ฐ๋ฅํฉ๋๊น?
asciinema๋ ์์ ํ๋ก์ธ์ค(๊ธฐ๋ณธ์ ์ผ๋ก ์ ธ)์ ์์ stdout ์ถ๋ ฅ์ ๊ธฐ๋กํฉ๋๋ค. ์ด๋ค ์์ผ๋ก๋ ํ๋ฉด ๋ด์ฉ์ "์บก์ฒ"ํ์ง ์์ต๋๋ค. ์ธ์๋๋ ๋ด์ฉ(๋ชจ๋ ์ด์ค์ผ์ดํ/์ ์ด ์ํ์ค ํฌํจ)์ ์บก์ฒํ๊ณ ์์ฌ ํฐ๋ฏธ๋(pty)์ ์ฌ์ฉํ์ฌ ์ด๋ฅผ ์ํํฉ๋๋ค.
์ง๊ธ๊น์ง pty๋ฅผ ์ง์ํ๋ Windows ํฐ๋ฏธ๋์ ์ฐพ์ง ๋ชปํ์ง๋ง ์ต๊ทผ์ http://babun.github.io ๋ฅผ ๋ฐ๊ฒฌํ์ต๋๋ค. ํ์ด์ง ๋ด์ฉ: Mintty is the console used in babun.
Mintty ํ์ด์ง(https://mintty.github.io)๋ ๋ค์๊ณผ ๊ฐ์ด ๋งํฉ๋๋ค: Similarly to other Cygwin/MSYS terminals based on pseudo terminal ("pty") devices (...)
๊ด๋ จ ๋ฌธ์ ์ ๋ํ ๊ธด ํ ๋ก ์ค๋ ๋๊ฐ ์์ต๋๋ค: https://github.com/mintty/mintty/issues/56
๋๊ตฐ๊ฐ Windows์์ pty๋ฅผ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ์ฐพ์ผ๋ฉด(๋๋ pty๋ฅผ ๊ฐ์ฅํ์ง๋ง ์์ stdout ์คํธ๋ฆผ์ ์ ๊ณตํ๋) asciinema-on-windows์ ์ ๊ทผํ ์ ์์ต๋๋ค.
๊ธฐ๋ณธ cmd ์ง์์ ๊ด์ฌ์ด ์์ต๋๊น?
https://asciinema.org/a/0nsiofsbhypumh6vy5jx6wuog
๊ทธ๋ฌ๋ ํ์ฌ ์คํ์ ์ ๋๋ค.
@mattn ์ ! ๋ฌผ๋ก ์ด๊ฒ์ด ์ด๋ป๊ฒ ๋ฌ์ฑ๋์๋์ง ๊ถ๊ธํฉ๋๋ค.
Windows์์ ๋ น์ํ๋ ๋ฐ ๊ด์ฌ์ด ์๋ ์ฌ๋์ ์ํด @mattn ์ ์คํ ๋ถ๊ธฐ๊ฐ ์์ต๋๋ค. https://github.com/mattn/asciinema/tree/windows
์๋ ! ์๋ง๋ ์ด ํ๋ก์ ํธ๊ฐ ์ ์ฉํ ๊น์? https://github.com/adoxa/ansicon
์ฌ๋ฌ๋ถ, Windows์ฉ git bash์์ ์ด ๋๊ตฌ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๊น?
์ฆ MinGW . ์๋๋ฉด ๋ฐ๋ถ์์...
๋ฐฉ๊ธ https://github.com/mattn/asciinema/tree/windows ์์ ํฌํฌ๋ฅผ ์ค์นํ์ง๋ง cmd.exe
์คํ๋ฉ๋๋ค.
@andkirby Windows์ bash์์ ์๋ํ๋ค๊ณ ๋ค์์ง๋ง ์ง์ ์๋ํ์ง๋ ์์์ต๋๋ค.
์๋ฌธ์ด... :) ๊ฐ์ฌํฉ๋๋ค.)
@sickill ๋ณํฉ๋์๊ฑฐ๋ ์ง์ํ ๊ณํ์ด ์๊ธฐ ๋๋ฌธ์ ๋ซํ์ต๋๊น?
@masaeedu ๊ด์ฌ ๊ฐ์ฌํฉ๋๋ค.
๋ค์๊ณผ ๊ฐ์ ์ด์ ๋ก Windows๋ฅผ ์ง์ํ ๊ณํ์ด ์์ต๋๋ค.
ํ์ฌ๋ก์๋ ๊ทธ๋ด ๊ฐ์น๊ฐ ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
asciinema๋ Win10(WSL)์์ ์๋ฒฝํ๊ฒ ์ค์น ๋ฐ ์๋ํฉ๋๋ค. https://asciinema.org/a/123255
Windows ํฐ๋ฏธ๋์ ๋ นํํ๋ ค๋ฉด ์ค์ ๋ก ํดํน์ด ํ์ํฉ๋๋ค. AFAIK๋ MOV ๋ช ๋ น์ ์ฌ์ฉํ์ฌ ์ฝ์ ๋ฒํผ์ ์ง์ ์ฐ๊ธฐ ๋ฅผ ์ง์ํฉ๋๋ค. @miniksa
ํ์ฌ๋ก์๋ ๊ทธ๋ด ๊ฐ์น๊ฐ ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
๊ทธ๋งํ ๊ฐ์น๊ฐ ์์ต๋๋ค. Windows์ฉ Git Bash์์ ๋์์์ ๋ง๋ค ์ ์๋ ์ฃผ๋จธ๋๋ฅผ ๊ฐ๊ณ ์ถ์ต๋๋ค.
๋ค๋ง ๋ณด์ฌ์ค ๊ฒ์ด ๋ง๋ค. :)
@andkirby https://github.com/asciinema/asciinema/issues/150#issuecomment -305995768
์ด ๋ฌธ์ ์ ๋ํ ์ค๋ ๋๋ฅผ ๊ด์ฌ์ ๊ฐ์ง๊ณ ํ๋ก์ฐํ๊ณ ์์ต๋๋ค. ๋ฏธ๋์๋ Windows์ CMD, PowerShell ๋ฐ Git Bash(WSL ์ ์ธ)์์ Asciinema ์ฌ์ฉ์ ์ง์ํ๋ ์๋ฃจ์ ์ด ๋์ฌ ์ ์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
๊ทธ ๋์ ํด๋น ๋ฐฉํฅ์ ๋์์ด ๋ ์ ์๋ ๋ฆฌ์์ค์ ๋ํ ๋ช ๊ฐ์ง ๋งํฌ๋ฅผ ์ญ์ ํฉ๋๋ค.
winpty๋ Windows ์ฝ์ ํ๋ก๊ทธ๋จ๊ณผ ํต์ ํ๊ธฐ ์ํด Unix pty-master์ ์ ์ฌํ ์ธํฐํ์ด์ค๋ฅผ ์ ๊ณตํ๋ Windows ์ํํธ์จ์ด ํจํค์ง์ ๋๋ค. ํจํค์ง๋ Cygwin/MSYS pty์์ Windows ์ฝ์ ํ๋ก๊ทธ๋จ์ ์คํํ๊ธฐ ์ํ Cygwin ๋ฐ MSYS์ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ(libwinpty)์ ๋๊ตฌ๋ก ๊ตฌ์ฑ๋ฉ๋๋ค.
์ฐธ๊ณ : winpty๋ ์๋ node-pty ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ ์ฌ์ฉ๋ฉ๋๋ค.
node.js์ ๋ํ forkpty(3)
๋ฐ์ธ๋ฉ. ์ด๋ฅผ ํตํด ์์ฌ ํฐ๋ฏธ๋ ํ์ผ ์ค๋ช
์๋ฅผ ์ฌ์ฉํ์ฌ ํ๋ก์ธ์ค๋ฅผ ๋ถ๊ธฐํ ์ ์์ต๋๋ค. ์ฝ๊ธฐ ๋ฐ ์ฐ๊ธฐ๋ฅผ ํ์ฉํ๋ ํฐ๋ฏธ๋ ๊ฐ์ฒด๋ฅผ ๋ฐํํฉ๋๋ค.
๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ์ ์ ์ฉํฉ๋๋ค.
node-pty๋ Linux, macOS ๋ฐ Windows๋ฅผ ์ง์ํฉ๋๋ค. winpty ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํ์ฉํ์ฌ Windows ์ง์์ด ๊ฐ๋ฅํฉ๋๋ค.
@tajmone ๊ฐ๋ฅํ ์ต์ ์์ฝ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. asciinema๊ฐ Python์ผ๋ก ์์ฑ๋์์ผ๋ฏ๋ก node-pty๋ฅผ ์ฌ์ฉํ ์ ์์ ๊ฒ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค.
์ ๋ WSL์ ์ต์ํ์ง ์์ต๋๋ค. ์ด ๋ถ๋ถ์ด Win10์ ์ผ๋ถ์ ๋๊น, ์๋๋ฉด ๋ณ๋๋ก ์ค์นํด์ผ ํฉ๋๊น?
์ ๋ WSL์ ์ต์ํ์ง ์์ต๋๋ค. ์ด ๋ถ๋ถ์ด Win10์ ์ผ๋ถ์ ๋๊น, ์๋๋ฉด ๋ณ๋๋ก ์ค์นํด์ผ ํฉ๋๊น?
๋๋ ...ํ์ง๋ง ๋ด๊ฐ ์ฝ์ ๋ฐ์ ๋ฐ๋ฅด๋ฉด WSL์ Win 10์ ์ ํ์ ์ผ๋ก ์ค์นํ ์ ์์ผ๋ฉฐ ์ค์ Ubuntu ๋ฐฐํฌํ์์ ๋ถํ์ ์ค์นํฉ๋๋ค. ์ง๊ธ ๋น์ฅ ํ์ํ ๋ชจ๋ ๊ฒ์ ์ ๊ณตํ๋ Windows์ฉ Git Bash๊ฐ ์ด๋ฏธ ์์ผ๋ฏ๋ก ์ด์ ๋ํด ์กฐ๊ธ ๋ ์๊ฒ ๋ ๋๊น์ง ์ค์นํ์ง ์๊ฒ ์ต๋๋ค. WSL์ ํ์คํ Git Bash๋ณด๋ค ๋ ๋ง์ ๋๊ตฌ๋ฅผ ์ ๊ณตํ๊ณ ๋ฒ์๊ฐ ๋ ๋์ต๋๋ค. ํ์ง๋ง ๋ ๋ง์ ๊ณต๊ฐ์ ์ฐจ์งํ๊ธฐ๋ ํฉ๋๋ค.
@tajmone @andkirby ์กฐ๊ธ ๋ฆ์์ง๋ง COMSPEC=cmd
, COMSPEC=bash
๋๋ COMSPEC=powershell
๋ฅผ ์ฌ์ฉํ์ฌ Matt์ ํฌํฌ๋ก ๋ค๋ฅธ ์์ ์ค์ ํ ์ ์์ต๋๋ค. IMHO, COMSPEC์ ์ด๋ฌํ ์ข
๋ฅ์ ๊ธฐ๋ฅ์ ๋ํด ์ค์ ํ๋ ์ฌ๋ฐ๋ฅธ Windows ๋ณ์์
๋๋ค. ์๋ ์ถ๋ ฅ ์์:
๋ช
๋ น:
https://asciinema.org/a/r0UNULw8K5r0HV35kTLOatAbX
WSL Bash(ํ์ค ํฐ๋ฏธ๋ ๋ด์์ ์คํ):
https://asciinema.org/a/XtLu8rh65uFekim1VbWamNcmh
ํ์์:
https://asciinema.org/a/HttJNKCwM9Tb1NlVP5PFy6Ftx
๊ฐ์ธ์ ์ผ๋ก ํจ๊ณผ๊ฐ ์งฑ์งฑํ๋ค๊ณ ์๊ฐํฉ๋๋ค...
@fquinner ๊ฐ์ฌํฉ๋๋ค! ๋๋ Matt์ ํฌํฌ์ ๋ํด ์ฌ๊ธฐ์ ๊ธฐ์ ์ฝ์์ง๋ง ๊ทธ๊ฒ์ด ๊ทธ๋ฌํ ์๋ ์ํ์ ๋๋ฌํ๋ค๋ ๊ฒ์ ๊นจ๋ซ์ง ๋ชปํ์ต๋๋ค. ๊ทํ๊ฐ ์ ๊ณตํ ๋งํฌ๋ ์ํฉ์ ๋ช ํํ ํ์ต๋๋ค.
ํ์คํ ์กฐ์ฌํ๊ฒ ์ต๋๋ค!
๊ทธ๋์ asciinema๋ Windows cmd์์ ์คํ๋์ง ์์์ต๋๊น?
๋ค๋ฅธ ์ต์ ์ https://github.com/Microsoft/console ์์ ๋ฌธ์ ๋ฅผ ์ด์ด pty ํธํ API๋ฅผ cmd์ ์ถ๊ฐํ๋ ๊ฒ์ ๋๋ค. @bitcrazed ์ ๊ฐ์ Microsoft Windows ์ฝ์ ์์ง๋์ด๋ง ํ์ด Github์ ์์ต๋๋ค.
@joelhandwell ์ด ๋งํ ๊ฒ :) ์ด Joe๋ฅผ ์ ์ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์์ ๋ฆฌํฌ์งํ ๋ฆฌ์์ ์ฌ๋ฌ๋ถ์ ์๊ฒฌ์ ๊ธฐ๋ค๋ฆฌ๊ฒ ์ต๋๋ค. ;)
@bitcrazed ๋ฌธ์ ๋ฅผ ๋ง๋ค๋ ค๊ณ ํ์ง๋ง ์ด๋ฏธ @be5invis ๊ฐ https://github.com/Microsoft/console/issues/57 ์ ์ ์ถํ์ต๋๋ค! ์ด ๋ฌธ์ ์ ์ฌ๋๋ค์ ๋ฌธ์ ์ ๋ง์ ๐๋ฅผ ์ ๊ณตํ๊ณ Microsoft์ ๋ ๋ง์ ๊ด์ฌ์ ๋ ์ ์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
ํด๊ฒฐ ๋ฐฉ๋ฒ์ด๋ ํดํน์ ์ํ์ง ์์ผ๋ฉด go-winpty๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
@fquinner , ์ฃ์กํฉ๋๋ค. ์ด ๋น๋์ค๋ฅผ ์ด๋ป๊ฒ ๋ นํํ๋์ง ์์ธํ ์จ ์ฃผ์๊ฒ ์ต๋๊น?
Windows์์ @mattn fork๋ฅผ ์ค์นํ๊ณ ์คํํ๋ ค๊ณ ์๋ํ์ง๋ง No module named 'termios'
์ค๋ฅ ๋ฅผ ์์ ํ๋ ๋ฐฉ๋ฒ์ ์ดํดํ์ง ๋ชปํฉ๋๋ค.
๊ฐ์ฌ ํด์.
์๋์ ๊ฐ์ด ๋น๋ํด ๋ณด์ธ์.
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
@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)
๊ฐ์ฌ ํด์.
๋ฏธ์, ๋ด ์ค์์์ด. ์์ ๊ฐ์ด ๋ค์ ์๋ํด์ฃผ์ธ์.
@mattn ,
pip install asciinemawindows
.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)
๊ฐ์ฌ ํด์.
mattn์ ํฌํฌ ์ค์น ๋ฌธ์ ์ ๋ํ ํ ๋ก ์ mattn์ repo๋ก ์ด๋ํ์ญ์์ค. ๊ฐ์ฌ ํด์! ;)
์ผ๋ฐ์ ์ธ Windows ์ง์์ ๋ํด ๋ ผ์ํ๋ ค๋ฉด asciinema์ ํ ๋ก ํฌ๋ผ์ ์ด์ฉํ์ญ์์ค: https://discourse.asciinema.org/
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
Windows์์ ๋ น์ํ๋ ๋ฐ ๊ด์ฌ์ด ์๋ ์ฌ๋์ ์ํด @mattn ์ ์คํ ๋ถ๊ธฐ๊ฐ ์์ต๋๋ค. https://github.com/mattn/asciinema/tree/windows