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 #103

Closed
siennathesane opened this issue May 31, 2018 · 32 comments · Fixed by #150
Closed

Windows Support #103

siennathesane opened this issue May 31, 2018 · 32 comments · Fixed by #150
Assignees
Labels
💪 improvement "Where we're going, we don't need roads." 💨 windows Windows, Cygwin, etc. wontfix

Comments

@siennathesane
Copy link
Contributor

Great project! I'm a Windows guy, so naturally I tried it on Windows in PowerShell. Works for me with go build -v -o wtf.exe or go install -v since I didn't have make installed.

There are some areas that do need fixing, but I wanted to start a top level issue with some of what I see out of the box with a vanilla config:

  • [] Bad Character Encoding in the box headers.
  • [] Linux-specific tools used.
  • [] Makefile only works on Linux.

image

You can see some of the issues in the screenshot. If you can point me to where that code exists, I might be able to help make it work as intended on Windows.

@senorprogrammer
Copy link
Collaborator

For the title characters, those are all hard-coded into the widgets themselves as unicode characters (i.e.: https://github.com/senorprogrammer/wtf/blob/bbdc860625ed45001bdc8bd737eb3643a5baba33/bamboohr/widget.go#L19).

Security is entirely macOS-specific, however extracting that into platform-specific code shouldn't be too tough. Same with the build settings.

OS and Build are macOS-specific, in the System module, a file called system_info.go. Rename that to macos.go, add a Windows-specific version, and branch in widget.go here https://github.com/senorprogrammer/wtf/blob/bbdc860625ed45001bdc8bd737eb3643a5baba33/system/widget.go#L30 and that shouldn't be too tough to get working either.

@senorprogrammer senorprogrammer added the 💪 improvement "Where we're going, we don't need roads." label May 31, 2018
@siennathesane
Copy link
Contributor Author

Gotcha, I will see how it goes, thanks!

@jon-peel
Copy link

jon-peel commented Jun 1, 2018

@mxplusb is it possible to distribute a Windows binary if you have already built it, or would it need to built per machine?

@siennathesane
Copy link
Contributor Author

@Thorocaine depends on the license @senorprogrammer has, but once it's built, I'm sure it can get distributed by someone. :)

@senorprogrammer
Copy link
Collaborator

If the MIT license doesn't support that (and I'm pretty sure it does), then I'll switch to a license that does. You should be able to distribute whatever you build.

@jon-peel
Copy link

jon-peel commented Jun 4, 2018

I did manage to get it working (mostly) in Windows Subsystem for Linux.
The only thing that I have tried that doesn't show anything is the Calendar.

@siennathesane
Copy link
Contributor Author

@Thorocaine go build -v -o wtf.exe works, there are just some weird nuances. If you are curious what support looks like, just take a look at #150.

@sspaink
Copy link

sspaink commented May 10, 2019

Is there an update on distributing Windows binaries? There isn't a Windows binary included in the current release. Are there maybe still activate tickets waiting for completion before distribution is possible?
Thanks!

@senorprogrammer
Copy link
Collaborator

I just added a Windows target to the .goreleaser config. Next release we'll see what happens. I'll update here when that's done.

@siennathesane
Copy link
Contributor Author

@senorprogrammer there are some changes coming in 1905 that implement much better Terminal support and might make it a bit more feasible to do natively.

@senorprogrammer
Copy link
Collaborator

What does 1905 refer to?

@siennathesane
Copy link
Contributor Author

siennathesane commented May 10, 2019

1905 is the next release of Windows, comes out in May, it was delayed from March and was supposed to be 1903. Windows 10 is now released as Windows <2-digit year><2-digit month>, so 1809 is September 2018, 1903 is March 2019, 1905 would be May 2019. Very similar to the way Ubuntu is released.

The changes coming in 1905 include ConPTY, which is a native pseudo TTY for Windows, and it has support for Unicode, which is great. There is also a new open source Windows terminal (github.com/Microsoft/Terminal) that will have first-class support for ConPTY, which is super useful, because it'll fix a lot of the unicode struggles which exist now.

@senorprogrammer
Copy link
Collaborator

Ah cool. I don't have access to a Windows machine so any help that Windows users can provide in trying out WTF on Windows is much appreciated.

@senorprogrammer
Copy link
Collaborator

Has anyone still paying attention to this thread tried to get WTF running under Windows r1905 per @mxplusb's comment above? I'd love to know if you've had any success.

@siennathesane
Copy link
Contributor Author

I can take a look at it later today (assuming I remember).

@siennathesane
Copy link
Contributor Author

Here is what it looks like under build 18936. About the same as when I filed this issue.

image

@siennathesane
Copy link
Contributor Author

Apparently I spoke too soon, it just panicked.

image

panic: runtime error: index out of range
goroutine 23 [running]:
github.com/rivo/tview.(*TextView).Draw(0xc42018c410, 0xc629e0, 0xc42007b380)
/mnt/p/go/src/github.com/rivo/tview/textview.go:738 +0x13cc github.com/rivo/tview.(*Grid).Draw(0xc420170360, 0xc629e0, 0xc42007b380)
/mnt/p/go/src/github.com/rivo/tview/grid.go:582 +0x1514 github.com/rivo/tview.(*Pages).Draw(0xc4201843f0, 0xc629e0, 0xc42007b380)                                                                                                /mnt/p/go/src/github.com/rivo/tview/pages.go:246 +0xf9 github.com/rivo/tview.(*Application).Draw(0xc4201803f0, 0x0)                                                                                                        /mnt/p/go/src/github.com/rivo/tview/application.go:265 +0xcf main.redrawApp(0xc4201803f0)
/mnt/p/go/src/github.com/senorprogrammer/wtf/wtf.go:94 +0xd1 created by main.main
/mnt/p/go/src/github.com/senorprogrammer/wtf/wtf.go:231 +0x330

@doxxx
Copy link

doxxx commented Aug 28, 2019

This is what the sample config looks like in Windows 10 1903 in the new Windows Terminal beta:

image

It flickers every time it updates, which is probably a Windows Terminal problem.

EDIT: The blue background is from the default Windows Terminal configuration for the Powershell profile.

@siennathesane
Copy link
Contributor Author

@doxxx can you try it in PSCore 6?

@doxxx
Copy link

doxxx commented Aug 28, 2019

Using PSCore 6 in Windows Terminal it looks the same, and flickers as well.

However, using PSCore 6 in the default Windows console, the box characters look better:

image

However, it still flickers on update.

@siennathesane
Copy link
Contributor Author

siennathesane commented Aug 28, 2019

That's really strange it flickers. @bitcrazed any reason you can think of that would cause an application to flicker on the default terminal?

@bitcrazed
Copy link

Sorry - tough to follow: What flickers and when? If you can repro, please find/file an issue in the Terminal repo: https://github.com/microsoft/terminal.

Thx.

@doxxx
Copy link

doxxx commented Aug 28, 2019

The entire WTF UI visibly repaints once a second -- probably when the data displayed is updated. It also happens in bursts during startup, which lends credence to the on data update theory. This occurs for me in PowerShell 5 and 6 in both the normal Windows console and the new Windows Terminal, on Windows 10 1903.

If I can figure out how to capture a video demonstrating it, I'll post it.

@doxxx
Copy link

doxxx commented Aug 28, 2019

So, this is interesting. I originally reported this bug from my work laptop, running Windows 10 Enterprise 1903. I just tried it at home on Windows 10 Home 1903 using PowerShell 5 in Windows Terminal, and it does not flicker.

So there's something else at play here.

@doxxx
Copy link

doxxx commented Aug 28, 2019

I noticed something else, just a small bug:

image

The top right corner of the box is not drawn correctly. If I resize the window, I can briefly see that it's drawing the top of the box one character too long, so the corner box character is being cut off on the right side of the window.

@siennathesane
Copy link
Contributor Author

I checked this on my Mac with dev, and I didn't see this behaviour, so it must be specific to Windows.

If I remember, I will check on this either later tonight or tomorrow. Seems Windows-specific. I have a few theories but will have to do some digging and testing.

@senorprogrammer senorprogrammer pinned this issue Aug 30, 2019
@ragebflame
Copy link

I am seeing the flickering also.

  • Windows 7
  • Cmder v1.3.12

@senorprogrammer senorprogrammer added the 💨 windows Windows, Cygwin, etc. label Dec 11, 2019
@glennsarti
Copy link

So it looks like WTF cannot even be built on Windows anymore from v0.33.0 onwards 😢😢😢. My suspicion is e23cec2 has broken it due to .Start not being exposed on Windows systems.

Also creack/pty does not appear to support Windows correctly anyway (creack/pty#95)

After reading through the comments something that struck me was the conflating of Shell, Terminal and Console. (yay for naming things!). e.g. Using PowerShell (the shell) in the newer Windows Terminal (which has the pty support). doxx did a good job differentiating that in their testing. Need to be careful of that.

C:\Source\tmp\wtf [master ≡]> git reset --hard v0.33.0
HEAD is now at b333a149 Update CHANGELOG.md
C:\Source\tmp\wtf [master ↓82]> go install
go: downloading github.com/xanzy/go-gitlab v0.38.1
...
# github.com/wtfutil/wtf/modules/cmdrunner
modules\cmdrunner\widget.go:146:12: undefined: pty.Start
C:\Source\tmp\wtf [master ↓82]> git reset --hard v0.32.0
HEAD is now at 9c9446fc fixing goreleaser config
C:\Source\tmp\wtf [master ↓182]> go install -v
go: downloading github.com/gdamore/tcell v1.3.0
...
C:\Source\tmp\wtf [master ↓182]> 

@bitcrazed
Copy link

@glennsarti:

something that struck me was the conflating of Shell, Terminal and Console. (yay for naming things!)

TELL ME ABOUT IT! :) This is one of the reasons I wrote a multi-part blog series on the history, evolution, and internal architecture of the Windows command-line, concluding with the post announcing the new ConPTY.

Alas, for naming, I often say:
image

As per my prior suggestion (though I don't see this issue referenced in the Terminal repo right now) - if you're able to reliably repro this problem, please do file an issue in the Windows Terminal repo. This is where the team that owns the legacy Windows Console, the new Windows Terminal, and all of Windows' Command-line infrastructure live. If this is an issue with the Console/Terminal, as opposed, for example, to VT causing an expected full refresh, the team will be happy to work with you to figure out a fix, as schedules etc. allow.

Also note that since Terminal is open-source, and should you be sufficiently interested in this issue, you can also clone and build your own Windows Terminal and set breakpoints to debug the issue and find out what's causing the full-frame refresh.

HTH.

@stale
Copy link

stale bot commented Jan 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 11, 2022
@eabase
Copy link

eabase commented Jan 12, 2022

Any news here? I don't see why there would be an issue on windows. I was using this before.

@stale stale bot removed the wontfix label Jan 12, 2022
@stale
Copy link

stale bot commented Apr 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 12, 2022
@stale stale bot closed this as completed Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 improvement "Where we're going, we don't need roads." 💨 windows Windows, Cygwin, etc. wontfix
Development

Successfully merging a pull request may close this issue.

9 participants