[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Firing a shell function when I change directories
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] Firing a shell function when I change directories |
Date: |
Fri, 7 Dec 2018 10:45:14 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 |
On 12/7/18 10:19 AM, Maxim Kupfer wrote:
> Hi all,
>
> I'm trying to automate the activation of my python virtual environment so
> that whenever I cd into a directory with a virtual environment, it
> automatically activates. I can already create a function that checks if the
> directory venv is available (and activate if it is), but I can't figure out
> how to make this run after I enter a new directory. Hoping I could get some
> help from this mailing list.
Use a `cd' shell function. There are several examples in the bash
distribution.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://tiswww.cwru.edu/~chet/