"Open Shell Here" context menu fails to work with Babun #183

Closed
harrisitservices opened this Issue Jul 9, 2014 · 16 comments

Comments

Projects
None yet
8 participants
@harrisitservices

Any explorer context menus I create to "open shell from here" always open the shell to the user's home folder. Is this some kind of setting specific to Babun? I even tried running, "chere -i -c -t mintty" and when I run the entry in the context menu it takes me to the users home folder again. Any ideas what I'm doing wrong?

@kubamarchwicki

This comment has been minimized.

Show comment
Hide comment
@kubamarchwicki

kubamarchwicki Aug 9, 2014

Contributor

+1
unsetopt AUTO_CD in .zshrc doesn't seem to help

Contributor

kubamarchwicki commented Aug 9, 2014

+1
unsetopt AUTO_CD in .zshrc doesn't seem to help

@harg

This comment has been minimized.

Show comment
Hide comment
@harg

harg Nov 22, 2014

Install chere :
pact install chere

Edit babun.bat and insert :
set CHERE_INVOKING=1

Edit /usr/local/etc/babun.zsh and comment the line :
source /etc/zprofile
see #205 (comment) for explanations

Run :
chere -i -c -t mintty -s zsh

harg commented Nov 22, 2014

Install chere :
pact install chere

Edit babun.bat and insert :
set CHERE_INVOKING=1

Edit /usr/local/etc/babun.zsh and comment the line :
source /etc/zprofile
see #205 (comment) for explanations

Run :
chere -i -c -t mintty -s zsh

@kubamarchwicki

This comment has been minimized.

Show comment
Hide comment
@kubamarchwicki

kubamarchwicki Dec 30, 2014

Contributor

+1 - works like a charm!

Contributor

kubamarchwicki commented Dec 30, 2014

+1 - works like a charm!

@tombujok

This comment has been minimized.

Show comment
Hide comment
@tombujok

tombujok Feb 4, 2015

Contributor

@kubamarchwicki Kuba, waiting for a pull request :-)

Contributor

tombujok commented Feb 4, 2015

@kubamarchwicki Kuba, waiting for a pull request :-)

@FichteFoll

This comment has been minimized.

Show comment
Hide comment
@FichteFoll

FichteFoll Mar 24, 2015

I've been working on this for too much time and tried all the other solutions without chere I could find to no avail. pact install chere itself fails because the md5 doesn't match it seems.

{ ~ }  » pact install chere                                                                     ~
Working directory is /setup
Mirror is http://mirrors.kernel.org/sourceware/cygwin/
--2015-03-24 17:19:42--  http://mirrors.kernel.org/sourceware/cygwin//x86/setup.bz2
Resolving mirrors.kernel.org (mirrors.kernel.org)... 2001:4f8:4:6f:0:1994:3:14, 2620:3:c000:a:0:1994:3:14, 149.20.37.36, ...
Connecting to mirrors.kernel.org (mirrors.kernel.org)|2001:4f8:4:6f:0:1994:3:14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1362594 (1.3M) [application/octet-stream]
Saving to: ‘setup.bz2’

100%[==========================================================>] 1,362,594    330KB/s   in 4.8s

2015-03-24 17:19:47 (279 KB/s) - ‘setup.bz2’ saved [1362594/1362594]

Updated setup.ini

Installing chere
Found package chere
--2015-03-24 17:19:48--  http://mirrors.kernel.org/sourceware/cygwin//x86/release/chere/chere-1.4-1.tar.bz2
Resolving mirrors.kernel.org (mirrors.kernel.org)... 2001:4f8:4:6f:0:1994:3:14, 2620:3:c000:a:0:1994:3:14, 149.20.37.36, ...
Connecting to mirrors.kernel.org (mirrors.kernel.org)|2001:4f8:4:6f:0:1994:3:14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13856 (14K) [application/octet-stream]
Saving to: ‘chere-1.4-1.tar.bz2’

100%[==========================================================>] 13,856      --.-K/s   in 0.001s

2015-03-24 17:19:48 (12.8 MB/s) - ‘chere-1.4-1.tar.bz2’ saved [13856/13856]

MD5 sum did not match, exiting
{ ~ }  » 

I've been working on this for too much time and tried all the other solutions without chere I could find to no avail. pact install chere itself fails because the md5 doesn't match it seems.

{ ~ }  » pact install chere                                                                     ~
Working directory is /setup
Mirror is http://mirrors.kernel.org/sourceware/cygwin/
--2015-03-24 17:19:42--  http://mirrors.kernel.org/sourceware/cygwin//x86/setup.bz2
Resolving mirrors.kernel.org (mirrors.kernel.org)... 2001:4f8:4:6f:0:1994:3:14, 2620:3:c000:a:0:1994:3:14, 149.20.37.36, ...
Connecting to mirrors.kernel.org (mirrors.kernel.org)|2001:4f8:4:6f:0:1994:3:14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1362594 (1.3M) [application/octet-stream]
Saving to: ‘setup.bz2’

100%[==========================================================>] 1,362,594    330KB/s   in 4.8s

2015-03-24 17:19:47 (279 KB/s) - ‘setup.bz2’ saved [1362594/1362594]

Updated setup.ini

Installing chere
Found package chere
--2015-03-24 17:19:48--  http://mirrors.kernel.org/sourceware/cygwin//x86/release/chere/chere-1.4-1.tar.bz2
Resolving mirrors.kernel.org (mirrors.kernel.org)... 2001:4f8:4:6f:0:1994:3:14, 2620:3:c000:a:0:1994:3:14, 149.20.37.36, ...
Connecting to mirrors.kernel.org (mirrors.kernel.org)|2001:4f8:4:6f:0:1994:3:14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13856 (14K) [application/octet-stream]
Saving to: ‘chere-1.4-1.tar.bz2’

100%[==========================================================>] 13,856      --.-K/s   in 0.001s

2015-03-24 17:19:48 (12.8 MB/s) - ‘chere-1.4-1.tar.bz2’ saved [13856/13856]

MD5 sum did not match, exiting
{ ~ }  » 
@tombujok

This comment has been minimized.

Show comment
Hide comment
@tombujok

tombujok Mar 24, 2015

Contributor

There's already fix for that:
rossdavidsmith@608b752

You can adjust your /usr/local/bin/pact
Pact will be updated in the next release (hopefully in 2-3 days)

Contributor

tombujok commented Mar 24, 2015

There's already fix for that:
rossdavidsmith@608b752

You can adjust your /usr/local/bin/pact
Pact will be updated in the next release (hopefully in 2-3 days)

@FichteFoll

This comment has been minimized.

Show comment
Hide comment
@FichteFoll

FichteFoll Mar 24, 2015

Thanks! I updated the relevant parts manually and it worked.

Thanks! I updated the relevant parts manually and it worked.

@tombujok

This comment has been minimized.

Show comment
Hide comment
@tombujok

tombujok Mar 24, 2015

Contributor

@FichteFoll Could you sum up what you did to make it working? Maybe we could include it in the next release...
Pull request anybody? @kubamarchwicki @harg

Contributor

tombujok commented Mar 24, 2015

@FichteFoll Could you sum up what you did to make it working? Maybe we could include it in the next release...
Pull request anybody? @kubamarchwicki @harg

@FichteFoll

This comment has been minimized.

Show comment
Hide comment
@FichteFoll

FichteFoll Mar 24, 2015

I replaced

    # check the md5
    digest=`cat "desc" | awk '/^install: / { print $4; exit }'` 
    digactual=`md5sum $file | awk '{print $1}'`
    if ! [[ $digest == $digactual ]]
    then
      echo MD5 sum did not match, exiting
      exit 1
    fi

in .babun/cygwin/usr/local/bin/pact with

    # check the verification hash (md5 or sha512)
    digest=`cat "desc" | awk '/^install: / { print $4; exit }'`
    md5digactual=`md5sum $file | awk '{print $1}'`
    shadigactual=`sha512sum $file | awk '{print $1}'`
    if ! [[ $digest == $md5digactual || $digest == $shadigactual ]]
    then
      echo Verification hash did not match, exiting
      exit 1
    fi

I know that it currently calculates both sha512 and md5, but I'm not versed enough in bash to make that adjustment myself.

Currently trying to build a commandline that will open mintty in a certain directory.

I replaced

    # check the md5
    digest=`cat "desc" | awk '/^install: / { print $4; exit }'` 
    digactual=`md5sum $file | awk '{print $1}'`
    if ! [[ $digest == $digactual ]]
    then
      echo MD5 sum did not match, exiting
      exit 1
    fi

in .babun/cygwin/usr/local/bin/pact with

    # check the verification hash (md5 or sha512)
    digest=`cat "desc" | awk '/^install: / { print $4; exit }'`
    md5digactual=`md5sum $file | awk '{print $1}'`
    shadigactual=`sha512sum $file | awk '{print $1}'`
    if ! [[ $digest == $md5digactual || $digest == $shadigactual ]]
    then
      echo Verification hash did not match, exiting
      exit 1
    fi

I know that it currently calculates both sha512 and md5, but I'm not versed enough in bash to make that adjustment myself.

Currently trying to build a commandline that will open mintty in a certain directory.

@tombujok

This comment has been minimized.

Show comment
Hide comment
@tombujok

tombujok Mar 24, 2015

Contributor

I didn't mean pact ;)
I meant the "Open Shell Here" context menu. Does it work in the end, after executing the steps listed by harg?

Contributor

tombujok commented Mar 24, 2015

I didn't mean pact ;)
I meant the "Open Shell Here" context menu. Does it work in the end, after executing the steps listed by harg?

@FichteFoll

This comment has been minimized.

Show comment
Hide comment
@FichteFoll

FichteFoll Mar 24, 2015

Yes, it works exactly as said by @harg. I don't need the context menu (which is why I uninstalled it afterwards, using chere -u), but the ability to run babun via cmd or some other tool (total commander) and have it open in the current work directory.

Only (obious) side effect is: When I run babun with Ctrl + Alt + T (not sure why/where this is defined) it opens in /cygdrive/c/Windows/system32 and when I run the desktop shortcut it opens in /cygdrive/c/Users/Fichte/Desktop. There needs to be a more or less easy way to not always set CHERE_INVOKING so that it switches to ~ in those two cases.

Yes, it works exactly as said by @harg. I don't need the context menu (which is why I uninstalled it afterwards, using chere -u), but the ability to run babun via cmd or some other tool (total commander) and have it open in the current work directory.

Only (obious) side effect is: When I run babun with Ctrl + Alt + T (not sure why/where this is defined) it opens in /cygdrive/c/Windows/system32 and when I run the desktop shortcut it opens in /cygdrive/c/Users/Fichte/Desktop. There needs to be a more or less easy way to not always set CHERE_INVOKING so that it switches to ~ in those two cases.

kubamarchwicki added a commit to kubamarchwicki/babun that referenced this issue Apr 13, 2015

@tombujok

This comment has been minimized.

Show comment
Hide comment
@tombujok

tombujok Apr 14, 2015

Contributor

Fixed in 1.2.0
See release status: #304

Contributor

tombujok commented Apr 14, 2015

Fixed in 1.2.0
See release status: #304

@sunaj

This comment has been minimized.

Show comment
Hide comment
@sunaj

sunaj Jul 29, 2015

Fixed in 1.2.0
See release status: #304

I'm on Windows 7 64bit here with admin account, have tried installing Babun 1.2.0 several times to get the "Open Babun here" context menu to work, never managed to make it work out of the box. Eventually I went through harg's solution with added step 5:

  1. Run: pact install chere
  2. Edit babun.bat and insert: set CHERE_INVOKING=1
  3. Edit /usr/local/etc/babun.zsh and comment the line: source /etc/zprofile
  4. Run: chere -i -c -t mintty -s zsh
  5. Extra: use regedit.exe and: HKEY_CLASSES_ROOT\Directory\shell find the new zsh entry created by chere and copy value into the "open with babun" then delete unneeded zsh entry.

Now really looking forward to using it! :)

sunaj commented Jul 29, 2015

Fixed in 1.2.0
See release status: #304

I'm on Windows 7 64bit here with admin account, have tried installing Babun 1.2.0 several times to get the "Open Babun here" context menu to work, never managed to make it work out of the box. Eventually I went through harg's solution with added step 5:

  1. Run: pact install chere
  2. Edit babun.bat and insert: set CHERE_INVOKING=1
  3. Edit /usr/local/etc/babun.zsh and comment the line: source /etc/zprofile
  4. Run: chere -i -c -t mintty -s zsh
  5. Extra: use regedit.exe and: HKEY_CLASSES_ROOT\Directory\shell find the new zsh entry created by chere and copy value into the "open with babun" then delete unneeded zsh entry.

Now really looking forward to using it! :)

@jlupi

This comment has been minimized.

Show comment
Hide comment
@jlupi

jlupi Jul 29, 2015

Contributor

@sunaj cool that it works for you :)

have tried installing Babun 1.2.0 several times to get the "Open Babun here" context menu to work, never managed to make it work out of the box

What exactly is the problem, you could not install / upgrade to 1.2.0 or the shell-here plugin did not install correctly or you didn't see the 'Open babun here' in the context menu?

Contributor

jlupi commented Jul 29, 2015

@sunaj cool that it works for you :)

have tried installing Babun 1.2.0 several times to get the "Open Babun here" context menu to work, never managed to make it work out of the box

What exactly is the problem, you could not install / upgrade to 1.2.0 or the shell-here plugin did not install correctly or you didn't see the 'Open babun here' in the context menu?

@sunaj

This comment has been minimized.

Show comment
Hide comment
@sunaj

sunaj Jul 29, 2015

I never had an earlier version of Babun than 1.2.0 installed (heard of it
yesterday). The install went fine but when I used the included context menu
link "Open Babun here" it simply opened Babun at /Windows/system32/
locality no matter which subfolder I used it on. I tried installing Babun
in default location AND under "c:\cygwin64\babun.babun..", both exhibited
the same issue.

On a separate note I noticed that the path inside registry -
"HKEY_CLASSES_ROOT\Directory\shell" - got mangled quite badly when I
installed under the "c:\cygwin64\etc." path ("cygwin" got cut out and only
"c:64\etc." was left), correcting it did not help though - only going
through steps outlined above fixed the problem in permanent manner.

On Wed, Jul 29, 2015 at 6:22 PM, Lukasz Pielak notifications@github.com
wrote:

@sunaj https://github.com/Sunaj cool that it works for you :)

have tried installing Babun 1.2.0 several times to get the "Open Babun
here" context menu to work, never managed to make it work out of the box

What exactly is the problem, you could not install / upgrade to 1.2.0 or
the shell-here plugin did not install correctly or you didn't see the 'Open
babun here' in the context menu?


Reply to this email directly or view it on GitHub
#183 (comment).

sunaj commented Jul 29, 2015

I never had an earlier version of Babun than 1.2.0 installed (heard of it
yesterday). The install went fine but when I used the included context menu
link "Open Babun here" it simply opened Babun at /Windows/system32/
locality no matter which subfolder I used it on. I tried installing Babun
in default location AND under "c:\cygwin64\babun.babun..", both exhibited
the same issue.

On a separate note I noticed that the path inside registry -
"HKEY_CLASSES_ROOT\Directory\shell" - got mangled quite badly when I
installed under the "c:\cygwin64\etc." path ("cygwin" got cut out and only
"c:64\etc." was left), correcting it did not help though - only going
through steps outlined above fixed the problem in permanent manner.

On Wed, Jul 29, 2015 at 6:22 PM, Lukasz Pielak notifications@github.com
wrote:

@sunaj https://github.com/Sunaj cool that it works for you :)

have tried installing Babun 1.2.0 several times to get the "Open Babun
here" context menu to work, never managed to make it work out of the box

What exactly is the problem, you could not install / upgrade to 1.2.0 or
the shell-here plugin did not install correctly or you didn't see the 'Open
babun here' in the context menu?


Reply to this email directly or view it on GitHub
#183 (comment).

@efstathios

This comment has been minimized.

Show comment
Hide comment
@efstathios

efstathios Aug 24, 2015

Would it make sense to distribute chere/xhere with the next release (post 1.2.0)?
Where I work, binaries cannot get through the firewall/proxy, so using pact to download chere/xhere to make this feature work is not possible.
I tried to manually download chere/xhere outside of pact manager and everything worked (chere-1.4-1.tar.bz2).

Would it make sense to distribute chere/xhere with the next release (post 1.2.0)?
Where I work, binaries cannot get through the firewall/proxy, so using pact to download chere/xhere to make this feature work is not possible.
I tried to manually download chere/xhere outside of pact manager and everything worked (chere-1.4-1.tar.bz2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment