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

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

Open
edmundlaugasson opened this issue Feb 27, 2021 · 5 comments

Comments

@edmundlaugasson
Copy link

edmundlaugasson commented Feb 27, 2021

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
Copy link
Author

edmundlaugasson commented Mar 2, 2021

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.

  • python must be installed in MS Windows - that part requires administrative permissions
  • created folder for scripts
    • mkdir %homepath%\scripts
  • created folder for additional file, as shellshare requires that location (understood during testing). Noticed, that this was not enough to download scripts.exe alongside with shellshare in same location (would be easier and more logical)
    • mkdir %homepath%\.shellshare
  • downloaded files
    • bitsadmin /transfer 1 https://raw.githubusercontent.com/vitorbaptista/shellshare/master/public/bin/shellshare %homepath%\scripts\shellshare
    • bitsadmin /transfer 1 https://github.com/vitorbaptista/shellshare/raw/master/public/bin/script.exe %homepath%\.shellshare\script.exe
  • created environment variable for user
    • quick open environment variables: super+R -> rundll32 sysdm.cpl,EditEnvironmentVariables
    • e.g. variable with name shellshare
    • value for variable:
      • "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe" H:\scripts\shellshare
    • if there is own instance of shellshare server, then the variable could be also (certainly replace with own appropriate values):
      • "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe" H:\scripts\shellshare --server own.address.com --room roomname --password ownpassword
    • later you can run it from CLI (cmd) or also from Run-window like %shellshare%

@edmundlaugasson
Copy link
Author

edmundlaugasson commented Mar 2, 2021

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

@edmundlaugasson edmundlaugasson changed the title proper installation and use of Shellshare under MS Windows 10 proper installation and use of Shellshare under MS Windows 10 (also tput and size error messages) Mar 2, 2021
@mikerenfro
Copy link
Contributor

mikerenfro commented Mar 3, 2021

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
Copy link
Author

edmundlaugasson commented Mar 3, 2021

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
Copy link
Contributor

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)".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants