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

Run cd hook on a new terminal instance #3317

Open
Sammidysam opened this issue Feb 22, 2015 · 5 comments
Open

Run cd hook on a new terminal instance #3317

Sammidysam opened this issue Feb 22, 2015 · 5 comments

Comments

@Sammidysam
Copy link

When I am using Emacs I will open a terminal with (ansi-term "/bin/bash") after I am inside of a project that will be working on. It will then use the directory that I am in to generate which path to go to. One of my projects uses an older Ruby version than my default on the system (2.2.0), as I like the newest stable being default, but the project requires a slightly older Ruby (2.1.5). My Gemfile has this older version of Ruby specified. When I am in a terminal and change directory to the project the cd hook gets correctly run and I get my correct Ruby. However, when I start a terminal in the directory of my project I have not run cd at all so it uses the old Ruby until I run cd . in the terminal. Is it at all possible to run the same cd hook when a terminal instance is just being made?

@rys
Copy link
Contributor

rys commented Feb 22, 2015

What happens if you use .ruby-version to specify the older Ruby, rather than in your Gemfile?

@Sammidysam
Copy link
Author

The same thing. Here is an image displaying what happens.

@Sammidysam
Copy link
Author

The same thing happens if I launch a terminal in that directory through Nautilus as illustrated here.

@csong-r7
Copy link

I have this exact same issue after setting up my environment in a fresh Ubuntu 14.04 install. My previous environments on other systems do not have this problem. I double checked that everything I can think of is identical, including the version of OS, RVM, Ruby, and even bash. Can't find a reason that would cause the cd hook to not run on a new system.

@lucasvel
Copy link

lucasvel commented Sep 3, 2015

Same issue here.
Fresh Ubuntu 14.04 install.
Checked on both konsole and gnome-terminal.
It was working for me for the past ~2 years on Ubuntu 12.04.

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

4 participants