vitorbaptista / shellshare

Live terminal broadcasts
https://shellshare.net
Apache License 2.0
223 stars 23 forks source link

proper installation and use of Shellshare under MS Windows 10 (also tput and size error messages) #68

Open edmundlaugasson opened 3 years ago

edmundlaugasson commented 3 years ago

Looks like now v1.1.0 has Windows support? How to properly install and use under Windows? Noticed, that %appdata%\Local\Microsoft\WindowsApps is in path, perhaps download shellshare and script.exe there? How to run then? Having own instance of shellshare server running, under Linux works like a charm.

edmundlaugasson commented 3 years ago

I guess it suppose to be so (used cmd). Following can be done as regular user, no administrative permissions required, except Python installing. clink is also useful for cmd users and I installed it also.

edmundlaugasson commented 3 years ago

Still I face with issues and cannot use shellshare under MS Windows 10:

'tput' is not recognized as an internal or external command,
operable program or batch file.
'tput' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
  File "H:\scripts\shellshare", line 190, in <module>
    size = terminal_size()
  File "H:\scripts\shellshare", line 58, in terminal_size
    cols = int(cols.stdout.read().strip())
ValueError: invalid literal for int() with base 10: b''

Tried to resize cmd window - didn't help... Although it would be useful, if can use larger terminal as otherwise commands are not visible for students.

Tested also with PowerShell 5.1.19041.610 (that version is included with MS Windows 10, 20H2) - same error messages.

Tested also with latest Python 3.9.2 - still same errors. Using 64-bit, MS Windows 10 EDU 20H2, OS build 10.0.19042.804

mikerenfro commented 3 years ago

I'd tested this originally with Git Bash in Windows, which includes its own tput and related executables. I also used Anaconda Python, which wouldn't require administrative rights, but any installed Python available in the PATH should work just as well.

There's an outstanding bug since September that's Windows-related, but it's not been resolved yet. For now, the simplest set of workable instructions for Git Bash should be:

mkdir ~/.shellshare
curl -sLo ~/.shellshare/script.exe https://shellshare.net/bin/script.exe
curl -sLo ~/shellshare http://get.shellshare.net && python ~/shellshare
edmundlaugasson commented 3 years ago

The question is related with native MS Windows command line and not Bash in Windows. When we try to use built-in CLI in MS Windows, then shellshare won't work with previously mentioned error messages. But the claim in #61 was, that shellshare will work without Cygwin emulation now, but actually it does not. We can also use WSL, which enables Bash in MS Windows, but then it's not actually MS Windows anymore, it is Linux subsystem, which is in case of Git Bash also. My main concern is native Windows CLI, what was also the claim of #61 ... At least WSL is part of Windows 10 and we don't need to download manually, but just enable WSL. So, still we don't have shellshare for Windows working yet...

mikerenfro commented 3 years ago

Shellshare isn't my project by any means, I'm just someone who wanted to use it under Windows in some Software Carpentry workshops, which already use Git Bash. Shellshare definitely needs some utilities standard for Unix environments like tput, and until those are replaced, it won't be a 100% fit for standard Windows. The Python parts of Shellshare are incredibly lean, and it relies heavily on other Unix utilities to do the real work of screen management and recording.

@dpshelio did some PowerShell work in #61 , but I don't think that got integrated in, since he was also willing to go with a Git Bash environment for his Windows users, if I recall correctly.

So the project went from "doesn't support non-Cygwin Windows at all (due to missing tput and script)" to "supports Windows without Cygwin (if you've got Git Bash for tput, since we can download a compatible copy of script on the fly)".