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? #6

Open
ncovercash opened this issue Jan 16, 2018 · 7 comments
Open

Windows support? #6

ncovercash opened this issue Jan 16, 2018 · 7 comments

Comments

@ncovercash
Copy link

Sadly enough I have to ask this. Is windows support planned? It could possibly be as simple as compiling to a .exe with visual studio's tools, however that is not my expertise. With MinTTY and all most unix builtins are supported already.

@p-gen
Copy link
Owner

p-gen commented Jan 16, 2018

Sorry, there is no expected version for Windows in the near future but I am open to contributions as long as they respect the KISS principle.

@p-gen p-gen closed this as completed Sep 10, 2018
@AnthonyMastrean
Copy link

AnthonyMastrean commented Sep 10, 2018

Both the Windows Subsystem for Linux and Docker for Windows might provide a reasonable shortcut. If I can come up w/ some working instructions, I'll post them here for possible inclusion in the readme/wiki?

Although, perhaps the real issue is Windows console PTY support (although, that's upcoming, too).

@p-gen
Copy link
Owner

p-gen commented Sep 10, 2018

Thank you, if it's possible I'll have a look.

Note that smenu does not use ptys, ptys are only used by the test system that uses my other small tool: ptylie.

@p-gen p-gen reopened this Sep 13, 2018
@AnthonyMastrean
Copy link

I wrote a quick Dockerfile, which you can build locally

$ docker build --tag smenu .

Or, you can use the image I published to hub.docker.com.

$ docker pull anthonymastrean/smenu

Since it appears that smenu only takes input on STDIN, you need to use a little function (this runs OK in Git Bash, the only usable Windows port of Bash that I know of). Bash also seems to pass all unbound parameters to the function body (this is good; it's quite a bit more difficult to make this work in PowerShell, which I may explore).

$ function smenu { docker run --rm -it --name smenu anthonymastrean/smenu; }

You should be able to run the example in the README now... except I get this error (which I'm having trouble making sense of)

$ echo $(grep Vm /proc/$$/status | smenu -n20 -W $':\t\n' -q -c -b -g -s /VmH)
the input device is not a TTY.  If you are using mintty, try prefixing the command with 'winpty'

When I Google the error, I get articles like this one; but, I'm sure that I've installed Git for Windows correctly.

image

Let's try this winpty thing

$ function smenu { winpty docker run --rm -it --name smenu anthonymastrean/smenu; }
$ echo $(grep Vm /proc/$$/status | smenu -n20 -W $':\t\n' -q -c -b -g -s /VmH)
stdin is not a tty

😭

OK, so, it appears I have no idea how this whole STDIN/TTY thing works between Bash and Docker on Windows.

@p-gen
Copy link
Owner

p-gen commented Oct 2, 2018

Thank you for your work, Note that smenu can also read its words from a file (see the SYNOPSIS and DESCRIPTION parts in the manual). E.g. smenu -- file or simply smenu file when there is no ambiguity)

@AnthonyMastrean
Copy link

Uh-oh, now I'm thinking about doing something silly like...

function smenu {
    cat > /tmp/smenu
    docker run --rm -it -v /tmp/smenu:/tmp/smenu --name smenu anthonymastrean/smenu "$@" -- /tmp/smenu
}

@AnthonyMastrean
Copy link

At this point, I'd say it's probably better to actually compile w/ VC++ or something rather than chasing this Docker for Windows rabbit hole 🤷‍♂️ 🤗

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

3 participants