-
-
Notifications
You must be signed in to change notification settings - Fork 17
Git-bash now runs in MSys2 causing issues with the nano
binary being installed.
#31
Comments
nano
binary being installed.nano
binary being installed.
@ethanwhite tagging you just to make sure you see this. |
Thanks for reporting @jduckles. Unfortunately I'm a bit buried with the start of the semester at the moment, so I probably won't have a chance to take a look at this for a while. Sorry for not being able to jump on this right away. PRs or more info in the comments of this issue are certainly welcome if you have the chance to run it down. |
I don't have a Windows machine to even take a stab at this. Do you know of someone that is a Windows instructor I might ping? A stop-gap solution might be to make the download link go to a 2.4.x version of git-bash. Only problem I see is that all currently planned workshops will have to pull down the change from the template to fix that link. |
From Dirk Eddelbuettel:
|
The change in behavior resulted from the switch in Git for Windows to using MinTTY instead of the standard Windows console. Work arounds that can be used immediately:
I'm working on figuring out how to make this all seamless again, but wanted to get the quick fixes out for those of you having issues right now. |
I'm poking around with this tonight and the ConEmu program suggested in the Git for Windows FAQ seems to work fairly well. It's less wonky than winpty for me and, there's a configuration menu option to start up with bash by default. |
If I'm understanding this correctly this would require installing an additional program and changing a configuration option from the default. Is that correct? If so, then I'm not sure I understand the benefit of this over instructing the students to change the appropriate installation option in the standard Git for Windows install to avoid using MinTTY. |
Just caught a typo in my earlier work around it's |
That is probably the correct short-term solution. It gets things back to exactly where they were before the new Git release. I always feel bad for people stuck using the default Windows console, though. It has gotten a tiny bit better in Windows 7 and 8, but it still seems distractingly hard to use. Both ConEmu and MinTTY are nicer. |
Ah, got it. Yes, there are definitely better working environments, but when we've discussed this in the past the increased probability of errors in installation (e.g., by adding another program to the stack) have been considered to outweigh the benefits for the purposes of workshops. |
Not strictly relevant to this issue, but I've been tinkering around tonight and the MSYS2 stuff looks pretty promising. It also uses MinTTY, but it seems to wire up nano correctly when you install it, and I don't see a |
I can see two solutions to this general problem at the moment:
If folks have opinions on the preferable approach I'd love to hear them. Pinging @wking & @gvwilson. |
Maybe something along the lines of |
Good thought! This works for both nano and R, it doesn't work for launching Python since |
I do also notice that TERM seems to get set differently between the MinTTY and the default windows console: For MinTTY:
For cmd.exe:
|
This seems to be a fix (we're in the middle of a class so it's not fully field-tested yet). From the user's home directory in git-bash, type echo "winpty nano" > .swc/lib/nano/nanofix
chmod +x .swc/lib/nano/nanofix Now specify nanofix as the editor. |
Thank you all for tracking this one down so quickly. Also, why is
software so fricking hard??
|
It's not quite right as nano needs a command line argument for the file to edit: echo "winpty nano $1" > .swc/lib/nano/nanofix
chmod +x .swc/lib/nano/nanofix Now you can pass "nanofix -w" as the editor invocation. Hopefully this works! |
Sorry, this is not working correctly. The cursor keys don't work properly when nanofix is launched (you can edit the start of the file). Suggestions welcome... Perhaps for windows users we should just recommend notepad? |
Wow, this is an import catch that I wish I'd made last night. Thanks for reporting back @rmcd1024! I think our only choice at this point is to change the set up instructions or hard link to an older version of git bash. |
FYI while it is a clearly suboptimal, short-term workaround, you can type "start" from gitbash which will launch a win console in the current working dir with a reasonable PATH env variable. From this new console you can launch python, sqllite, nano and they behave as expected. |
PRs are now in to both the workshop-template [1] and site [2] repos to change the installation instructions. Once these are in instructors of workshops who have already setup their websites should pull these downstream or just copy and paste the changes into their sites. Since this seems to be the best we can do short of a larger scale reconsideration of the Windows stack I'm going to go ahead and close this issue. If anyone comes up with a better/supplemental plan for helping improve this situation with our Windows installer please open a new issue since this one has gotten a little messy. Huge thanks to @jduckles and folks on the mail list for reporting and to @lo5an, @rmcd1024, and @cgates for the great fixes/debugging/suggestions. [1] carpentries/workshop-template#235 |
On Fri, Aug 21, 2015 at 05:25:57PM -0700, Ethan White wrote:
It looks like msysGit has been superseded by Git for Windows 2.x 1. |
I agree that this looks promising and it would be great if someone has the time to play around with this and report back. |
Also, the Git for Windows SDK 1 seems to be using Inno Setup 2. |
Workaround for this issue: swcarpentry/windows-installer#31
A closed thread...this is how I learn.
save this file, and execute it from within the GitBash window using:
This doesn't open Notepad++ inside the GitBash window, but it opens it quickly, and gives the "feeling" you are working with the command-line window at all times. It's similar to what cgates suggested using "start". Note that you may have to change the paths in the batchfile to the individual computer. |
Old topic but encountered same 'redirection is not supported' problem in Nano(2.5.3) windows release. Cursor keys did not work, Git config property core.editor did not work as expected. This is how I solved using nano as an internal editor for rebase and etc git commands. Download Windows binary and unzip. https://www.nano-editor.org/dist/v2.5/NT/. I use
|
Solution:Put the following in function _print_terminal_emulator() {
local parent_ps="$(ps -p $PPID)"
echo "${parent_ps##*/}"
}
if [[ "$(_print_terminal_emulator)" == "mintty" ]]; then
function nano() { winpty nano "$@" ;} && export -f nano
function python() { winpty python "$@" ;} && export -f python
# more functions...
fi Of course, you could use aliases instead of functions, like this: if [[ "$(_print_terminal_emulator)" == "mintty" ]]; then
alias nano="winpty nano"
alias python="winpty python"
# more aliases...
fi But take note that the Bash manual states:
If you want to be able to use |
Some users are having issues with
nano
not running, it is present and in the path. This could cause issues with using nano in any upcoming workshops.They're getting a "Redirection not supported" error when trying to run
nano
This new version hit last-night and our workshop attendees who installed git-bash today are seeing the problem. See the release notes on Git for Windows 2.5.0.
I think this may be a 32-bit, 64-bit problem with the version of
nano.exe
we're using.The text was updated successfully, but these errors were encountered: