eshell(elisp shell)启动时读取什么设置文件? eshell如何设置其路径? [英] What setup file does eshell (elisp shell) read when it starts? How eshell sets its PATH?

查看:199
本文介绍了eshell(elisp shell)启动时读取什么设置文件? eshell如何设置其路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用emacs / eshell,echo $ PATH显示与$ PATH环境变量不同的路径。



我还检查了eshell没有读取.bashrc或.profile,我认为这是路径不同的原因。




  • eshell在启动时读取什么设置文件?

  • 如何设置其PATH? / li>
  • 如何使eshell的PATH与环境变量的PATH相同?



ADDED < h2>

正如JérômeRadix指出,PATH取决于我如何启动Aquamcs。




  • 当我点击按钮启动Aquamacs时,它有不同的路径。

  • 当我从命令行运行aquamacs时,它具有相同的路径。


解决方案


  • eshell启动时读取什么设置文件?



启动时不会执行安装文件。读取以下文件以定义初始历史记录和最后目录:

 〜/ .eshell / history 
〜/ .eshell / lastdir




  • 如何设置其PATH? / em>



在esh-util.el中,第240行:

 (defvar eshell-path-env(getenvPATH)
$ PATH的内容
它可能与\(getenv \PATH \\),当
`default-directory'指向一个远程主机时。)




  • 如何使eshell的PATH与环境变量的PATH相同?



它与emacs进程的PATH变量相同。我想象你在一个shell外面做一个echo $ PATH来比较emacs。如果PATH在Emacs和外部Emacs之间的shell之间是不同的,那是因为emacs和shell不执行相同的启动脚本。


With emacs/eshell, the "echo $PATH" shows different paths than that of $PATH environment variable.

And I also checked that eshell doesn't read .bashrc or .profile, and I think that's the reason why the path is different.

  • What setup file does eshell read when it starts?
  • How eshell sets its PATH?
  • How to make the eshell's PATH the same as the environment variable's PATH?

ADDED

As Jérôme Radix pointed out, the PATH depends on how I start the Aquamcs.

  • When I click the button to start Aquamacs, it has different PATH.
  • When I run 'aquamacs' from the command line, it has the same PATH.

解决方案

  • What setup file does eshell read when it starts?

No setup file is executed at startup. The following files are read to define the initial history and last directories :

~/.eshell/history
~/.eshell/lastdir

  • How eshell sets its PATH?

In esh-util.el, line 240 :

(defvar eshell-path-env (getenv "PATH")
  "Content of $PATH.
It might be different from \(getenv \"PATH\"\), when
`default-directory' points to a remote host.")

  • How to make the eshell's PATH the same as the environment variable's PATH?

It is the same as the PATH variable of the emacs process. I imagine that you do a echo $PATH on a shell outside emacs to compare. If PATH are differents between emacs and your shell outside emacs it is because emacs and your shell does not execute the same startup scripts.

这篇关于eshell(elisp shell)启动时读取什么设置文件? eshell如何设置其路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆