在Emacs中如何告诉shell它正在运行? [英] How do I tell a shell that it is running from within Emacs?
问题描述
该程序有一个选项,不能使用它,所以我想要能够转动在Emacs中的shell中运行该选项。
我在Emacs中从终端或使用编译模式执行此程序作为Makefile的一部分。 / p>
所以有一种方法可以让编译模式设置一个环境变量(或类似的东西),在Makefile中很容易捕获到使用该选项的适当时机? / p>
在make命令(在任何一种情况下)手动添加一个额外的参数是我想避免的。
EMACS在 I have a program that uses ansi terminal codes to do fancy stuff like erasing lines when it runs in the terminal. When that is run from within Emacs, it obviously screws up the buffer. The program has an option to not use those, so I'd like to be able to turn on that option when running in a shell within Emacs. I execute this program as a part of a Makefile, either from the terminal or using compile-mode in Emacs. So is there a way to have compile-mode set an environment variable (or something similar) that would be easy to catch in the Makefile to use the option when appropriate? Manually adding an extra argument to make in the make-command (in either of the cases) is what I am trying to avoid. EMACS sets the
这篇关于在Emacs中如何告诉shell它正在运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! Mx shell $ c $中设置
$ EMACS
环境变量c>会话,所以你应该检查一下(假设你不会在shell脚本中的其他地方无意中定义 EMACS
#从登录shell
ec在Emacs shell $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ b$EMACS
environment variable within M-x shell
sessions, so you should just check for that (assuming you don't inadvertently define EMACS
elsewhere within your shell scripts):# from login shell
echo $EMACS
# within Emacs shell
bash-4.2$ echo $EMACS
t