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 (MSYS2/git bash) #178

Open
ciarancourtney opened this issue Sep 7, 2022 · 5 comments
Open

Windows Support (MSYS2/git bash) #178

ciarancourtney opened this issue Sep 7, 2022 · 5 comments

Comments

@ciarancourtney
Copy link

If the prerequisites are 'Standard stuff: bash(4.3+), curl, tar, ..' the MSYS2 Bash shell, or the minimal one that comes with Git for Windows, should satisfy these requirements.

@curusarn
Copy link
Owner

Hi, RESH works in WSL on Windows.

My guess is that MSYS2 Bash and shell in Git for Windows is not actual bash so it won't likely have all the bash features RESH needs.

If you want to, you can clone the repo and try to build and install RESH from source in MSYS2 or Git Bash. (git clone, cd into the directory, and make install) If you see that it works then we can add windows to the installation and build.

ciarancourtney added a commit to ciarancourtney/resh that referenced this issue Dec 19, 2022
- check for $MSYSTEM since uname contains version
- Use nohup to daemonize
- closes curusarn#178
@ciarancourtney
Copy link
Author

Thanks @curusarn I started a branch on my fork will minimal changes to allow install on windows, and noted the following:

  1. On init, the following errors are output to terminal
resh PANIC unrecognized OS
resh-session-init ERROR: 2022/12/19 11:54:59 Flag Parsing error (rt sess boot):strconv.ParseFloat: parsing "": invalid syntax
  1. The TUI works as expected, but its very slow, and slows down all terminal commands significantly.
  2. The parsing error above is written on startup and shutdown of resh, on shutdown the PS1 is bare until you hit ctrl+c again.

In summary I think the biggest hurdle is the perf impact, do you think the bottleneck is in shell or go?

@curusarn
Copy link
Owner

  1. resh-session-init ERROR: 2022/12/19 11:54:59 Flag Parsing error (rt sess boot):strconv.ParseFloat: parsing "": invalid syntax

This error looks like the way Resh gets current time fails. Is date command available in MSYS2 bash? What does executing date +%s print?

The TUI gets a little slow when the searched history is very large (e.g. very large preexisting bash history). Could this be the case? How many lines in your bash history?

What do you mean by ... and slows down all terminal commands significantly.? How does the TUI slow don all terminal commands?

Resh does add some "invisible commands" to PS1 to be able to record history with directory, time, status, etc. I'm wondering if it the history recording works at all if the prompt gets broken. Can you check that commands are being recorded to Resh history?

This is how you can test it:

  • Open the MYSYS2 shell
  • Run something like echo "we want to see this in resh history"
  • Run tail ~/.resh_history.json

You should see the echo "we want to see this in resh history" in the output.

In summary I think the biggest hurdle is the perf impact, do you think the bottleneck is in shell or go?

Go should work the same on all platforms so the it shouldn't be slower on Windows than it is in WSL, on Linux or macOS. So based on that I would suspect shell to be the cause of the slowdown. There can be differences how the shell behaves between platforms.

@ciarancourtney
Copy link
Author

This error looks like the way Resh gets current time fails. Is date command available in MSYS2 bash? What does executing date +%s print?

Yes, its the proper GNU date, so it prints the same seconds as on Linux.

What do you mean by ... and slows down all terminal commands significantly.? How does the TUI slow don all terminal commands?

I'm pretty sure its the PS1 manipulation thats causing the slowdown. My bash history is 5000 lines for reference.

@curusarn
Copy link
Owner

curusarn commented Mar 2, 2023

Hi @ciarancourtney,

I have released RESH beta version: https://github.com/curusarn/resh/releases/tag/v3.0.0-rc2
In v3.0.0-rc2, I have eliminated some dependencies which might fix the date parsing errors.
It also has prebuilt binaries for Windows.

The install script and shell files still don't recognize Windows so you will need some patches but the binaries are there.

Let me know if this helps.

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