ãGit for Windowsãtty/mintty/winptyã¨ã¯ä½ãªã®ãï¼ãGitbashã
tty/minttyã¨ã¯ä½ãªã®ãï¼
Windowsç°å¢ã§ãLinuxæä½ãå¯è½ãªGitbashã§dockerã³ãã³ããªã©ããããããã¨ä»¥ä¸ã®ãããªã¨ã©ã¼ã¨ãªãã
$ docker exec -it unreal_container bash the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'
ä½ããã
ãå
¥åããã¤ã¹ã¯TTYã§ã¯ãªãããminttyã使ç¨ãã¦ãããªããã³ãã³ãã®å
é ã«ãwinptyããä»ãã¦ããã
ã¨ã®ãã¨ã
è¨ãããéããwinptyã使ç¨ããã°åé¡ãªãåãã®ã§ã.bash_profileã«aliasè¨å®ããã¦ãã¾ããã
ï¼è£è¶³ï¼
ãããã¯ä»¥ä¸ã«winptyçµç±ã«ãããã³ãã³ãã追å ã§ãOKãªããã§ãã
for name in node ipython php php5 psql python2.7 do case "$(type -p "$name".exe 2>/dev/null)" in ''|/usr/bin/*) continue;; esac alias $name="winpty $name.exe" done
以ä¸ãåèã«ãªãã¾ããã
â åè
Gitbashã¯ããã©ã«ãã§MinTTYã使ç¨ãã¦ãããããã¯Git for Windowsãã¤ã³ã¹ãã¼ã«ããéã®æ§æã¦ã£ã³ãã¦ã§é¸æãã¦ããã¨ã®ãã¨ã
ä½æ°ãªãããã©ã«ãã§ã¤ã³ã¹ãã¼ã«ãã¦ãã¾ãããã確ãã«é¸æããè¨æ¶ãããã¾ããã
ããã§ãUse MinTTYããé¸æããã¨ãBashããã³ããã¯ãWindowsã«å梱ããã¦ããCMDã³ã³ã½ã¼ã«ã§ã¯ãªããMinTTYã¿ã¼ããã«ã¨ãã¥ã¬ã¼ã¿ã¼ã§ãã¹ãããã¾ããMinTTYã¿ã¼ããã«ã¨ãã¥ã¬ã¼ã¿ã¯ãã³ãã³ãã®åã«winptyãä»ããªãéããWindowsã³ã³ã½ã¼ã«ããã°ã©ã ã¨äºææ§ãããã¾ãã
https://willi.am/blog/2016/08/08/docker-for-windows-interactive-sessions-in-mintty-git-bash/
winptyã¨ã¯ï¼
MinTTYã¯ãWindows APIã使ç¨ããããã°ã©ã ã¨å¯¾è©±ããå ´åãptyã®éäºææ§/æåã¨ã³ã³ã¼ãã®éäºææ§ã®åé¡ãããã¾ãåä½ããªãããããåé¿çã¨ãã¦winptyã¨ããã©ããã¼ã使ãããã«æ¨å¥¨ãã¦ããããã§ãã
ã¾ããããã¯MinTTYã®åé¡ã§ã¯ãªãã¨ã®ãã¨ã
https://github.com/mintty/mintty/wiki/Tips#inputoutput-interaction-with-alien-programs
ã¾ããããWindows10ããã©ã«ãã®ã³ã³ã½ã¼ã«ã«æ»ããããã°ãGit for Windowsã¤ã³ã¹ãã¼ã©ãåå®è¡ãã¦é¸æããªããã
ã©ããã¦ãMinTTYã使ãããå ´åã¯ãã¤ã³ã¿ã©ã¯ãã£ãã»ãã·ã§ã³ã§ã¯å
é ã«winptyãã¤ãã¾ãããã¨ãããã¨ã§ãã
ããããtty/minttyã¨ã¯ä½ãªã®ãï¼
ttyã¨ã¯ï¼
âttyâã¯ãã¨ãã¨ã¯ âãã¬ã¿ã¤ãâãæå³ãã âptyâ㯠âæ¬ä¼¼ãã¬ã¿ã¤ãâãæå³ãã¾ãã
https://codeday.me/jp/qa/20181203/23640.html
âttyã¯ç«¯æ«ãptyã¯ä»®æ³ç«¯æ«ï¼ããã«èªã¿æ¸ãããããã»ã¹ã®ç«¯æ«ã®ããã«æ©è½ããããä»ã®ãã®ã«ãã£ã¦ç®¡çãããããã¤ã¹ã¨ã³ããªï¼
ã³ã³ã½ã¼ã«ä¸ã§ãttyã³ãã³ããæã¤ã¨èªåã®ããã¤ã¹ãã¡ã¤ã«åã表示ããã¾ãã
ï¼æ¥ç¶ãã¦ãã人ã®åæã®ãããªãã®ï¼
unrealman@STN-XXXXX MINGW64 ~/dev/docker (master) $ tty /dev/pty0
ããã«ã»ãã·ã§ã³ãç«ã¡ä¸ãã¦ttyãå
¥åããã¨éãããã¤ã¹ãã¡ã¤ã«åã表示ããã¾ãã
ï¼ã»ãã·ã§ã³ãã¨ã«ããã¤ã¹ãã¡ã¤ã«åãçæãããï¼
unrealman@STN-XXXXX MINGW64 ~/dev/docker (master) $ tty /dev/pty1
ã¾ããã/dev/pty0ããå²ãå½ã¦ããã¦ãã端æ«å´ããã
$ echo "hogehoge" > /dev/pty1
ãå®è¡ããã¨ãã/dev/pty1ããå²ãå½ã¦ããã¦ãã端æ«ã«"hogehoge"ã¨è¡¨ç¤ºããã¾ãã
ã¤ã¾ããã©ã®ç«¯æ«ããå®è¡ããã¦ãããã表ãã¦ããæ å ±ã¨ãããã¨ã§ããããã§ãã
MinTTYã¨ã¯ï¼
Git for Windowsã®ã¤ã³ã¹ãã¼ã«ç»é¢ãåèã
ã¿ã¼ããã«ã¨ãã¥ã¬ã¼ã¿ã
ããã¯ãµã¤ãºãå¤æ´å¯è½ãªã¦ã¤ã³ãã¦ã§ãéé·æ¹å½¢ã®é¸æãUnicodeããµãã¼ããã¦ãããWindowsã³ã³ã½ã¼ã«ã»ããã°ã©ã ã¯ï¼å¯¾è©±åã®Pythonã®ãããªï¼MinTTYã®ä¸ã§åä½ãããããã«ãwinptyããéãã¦èµ·åããªããã°ãªããªãã
çµè«
ttyã¯ç«¯æ«ãæã£ã¦ãããã¨ã示ããã³ãã³ãã®åãæã¯æ¨æºã«å¯¾ããçµ±å¶ï¼ãã¼ãã¼ããä»ãã¦ã®å
¥åï¼ãããã¨æå¾
ãã¦ããã®ã«ãMinTTYï¼ä»®æ³ç«¯æ«ï¼ã使ç¨ãããã¨ã§ptyã¨ãªãç°å¸¸æ¤ç¥ããè¦åããã¦ããã¨ãããã¨ã§ããããï¼
ä¸æãæ´çã§ãã¦ãã¾ããã®ã§ãã¾ãã¢ãããã¼ããã¾ãã
â åè
https://codeday.me/jp/qa/20190802/1364237.html
https://codeday.me/jp/qa/20190112/131467.html