autojump icon indicating copy to clipboard operation
autojump copied to clipboard

Unsupported shell (tcsh). Only Bash and Zsh shells are supported.

Open abiy507 opened this issue 11 years ago • 10 comments

How to proceed? $~/autojump/autojump_v21.1.2 $ chmod +x install.sh $./install.sh Unsupported shell (tcsh). Only Bash and Zsh shells are supported

abiy507 avatar Aug 05 '14 13:08 abiy507

tcsh is not supported. The shell wrappers requires a cd hook and a couple of functions (look at autojump.bash as an example). I'd be happy to merge a PR if you or someone adds support.

wting avatar Oct 05 '14 00:10 wting

There is an autojump.tcsh file that you can source that provides basic functionality. However, the installation script needs to be run under bash or zsh, so you may want to try using a package manager or start a bash shell just to run that one script.

jkuan avatar Oct 06 '14 09:10 jkuan

I believe it is possible now to install tool under tcsh w/o the need to use bash? I can seem to do it with no problems. Issue comes later, as the line the tool says to add on tcshrc "[[ ...."" does not use a valid tcsh syntax.

kiteloopdesign avatar Oct 21 '20 05:10 kiteloopdesign

I believe it is possible now to install tool under tcsh w/o the need to use bash? I can seem to do it with no problems. Issue comes later, as the line the tool says to add on tcshrc "[[ ...."" does not use a valid tcsh syntax.

How do I do this exactly? I've installed autojump but when I added "[ -f /home/username/.linuxbrew/etc/profile.d/autojump.sh ] && . /home/username/.linuxbrew/etc/profile.d/autojump.sh" into my .tcshrc, it then returns me "BASH: undefined variable". I'm not very familiar with tcsh syntax, but I even tried putting the code in autojump.tcsh in my .tcshrc and it still did not work.

digitalguy99 avatar Oct 29 '20 07:10 digitalguy99

Hi, I was referring to above's comment : "However, the installation script needs to be run under bash or zsh, so you may want to try using a package manager or start a bash shell just to run that one script.". Basically that it can be installed but, as you well say, it doesn't work later.

kiteloopdesign avatar Oct 29 '20 08:10 kiteloopdesign

There is an autojump.tcsh file that you can source that provides basic functionality. However, the installation script needs to be run under bash or zsh, so you may want to try using a package manager or start a bash shell just to run that one script.

Hi, I was referring to above's comment : "However, the installation script needs to be run under bash or zsh, so you may want to try using a package manager or start a bash shell just to run that one script.". Basically that it can be installed but, as you well say, it doesn't work later.

@jkuan can you provide a tutorial on how I can use bash to install this on my tcsh?

digitalguy99 avatar Oct 29 '20 10:10 digitalguy99

Hi, I was referring to above's comment : "However, the installation script needs to be run under bash or zsh, so you may want to try using a package manager or start a bash shell just to run that one script.". Basically that it can be installed but, as you well say, it doesn't work later.

After several days of trying, I finally found out how it could be made to work:

  1. You have to have bash
  2. On your .tcshrc add:
alias jt "bash -c '. ~/.bashrc; j \!:1'"
alias j 'cd `jt \!:1`'

BUT this does mean that you have to add

[ -f /home/username/etc/profile.d/autojump.sh ] && . /home/username/etc/profile.d/autojump.sh

to your .bashrc first(as specified by the installer program after installing autojump on bash).

digitalguy99 avatar Nov 03 '20 01:11 digitalguy99

Thanks for the update @digitalguy99 !

However it doesn't work for me. I am getting a Bad ! arg selector error message

The steps I followed are :

  1. install using bash called from tcsh shell. That is to say bash is not a login shell
  2. add "[ -f /home/username/etc/profile.d/autojump.sh ] && . /home/username/etc/profile.d/autojump.sh" to .bashrc
  3. addding the mentioned alias to tcsh
  • Are you also using tcsh as your login shell? did you install autojump just by calling bash from tcsh?
  • note that you wrote one "[" instead of "[[", is this deliberate?

thanks

kiteloopdesign avatar Nov 09 '20 14:11 kiteloopdesign

@kiteloopdesign try adding

pwd_alias(){
  echo "$PWD"
}

to your .bashrc.

Then, create an autojump.tcsh file somewhere(preferably on your home directory). The code on your autojump.tcsh file should be as follows:

bash -c '. ~/.bashrc; autojump -a `pwd_alias`'

Finally, add

alias cwdcmd ~/folder_that_contains/autojump.tcsh

to your .tcshrc

digitalguy99 avatar Mar 31 '22 04:03 digitalguy99

Thats a good idea actually to wrap bash functions into tcsh

you don't even need the autojump.tcsh file, you can directly have that in the .tcshrc

alias cwdcmd 'bash -c "source ~/.bashrc; autojump -a `pwd_alias`"'

kiteloopdesign avatar Oct 29 '22 22:10 kiteloopdesign