pipenv和bash别名 [英] pipenv and bash aliases
问题描述
我在我的 .bash_profile
(Mac)中定义了一组核心的bash别名.但是,当我使用 pipenv shell
激活pipenv时,别名不起作用,bash的 alias
命令不返回任何内容.
I have a core set of bash aliases defined in my .bash_profile
(Mac). But when I activate a pipenv with pipenv shell
, my aliases don't work and the bash alias
command returns nothing.
是否需要配置步骤来生成从父shell继承bash别名的pipenv shell?
Is there a configuration step needed to spawn pipenv shells that inherit bash aliases from the parent shell?
推荐答案
别名永远不会被继承. .bash_profile
仅用于登录外壳程序,而 pipenv
显然会创建非登录交互式外壳程序.别名应在 .bashrc
中定义,在Mac上(默认情况下,终端仿真器将启动登录Shell)在Mac上,添加 [[-f〜/.bashrc]]&&源〜/.bashrc
到 .bash_profile
的末尾.
Aliases are never inherited. .bash_profile
is only sourced for login shells, and pipenv
apparently creates a nonlogin interactive shell. Aliases should be defined in .bashrc
, and on a Mac (where terminal emulators starts login shells by default), add [[ -f ~/.bashrc ]] && source ~/.bashrc
to the end of your .bash_profile
.
这篇关于pipenv和bash别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!