Pal*_*han 6 emacs bash shell ubuntu
我在ubuntu中安装了emacs(使用sudo apt-get install emacs).我讨厌的问题是,当我尝试从emacs中运行shell命令时(例如M-! ls)输出前面是这样的:
bash: cannot set terminal process group (-1): Invalid argument
bash: no job control in this shell
Run Code Online (Sandbox Code Playgroud)
在我的.emacs我都可以选择(setq shell-command-switch "-ic").这样我可以使用我的别名和命令.这没有给我工作上的问题,它让我使用我的别名.我如何使用我的别名但避免这个问题?
小智 0
我猜想,通过这样设置 shell 命令开关,您将在您的配置文件.profile或系统配置文件中执行依赖于 shell 中的作业控制的代码路径。
我将通过在正确的代码路径中定义所需的别名来修复此错误,以便出现在不以-i
您可以尝试-i使用--rcfile .aliases或类似的东西进行交换,以便在 emacs 中与您的登录 shell 中alias没有区别。alias如果您的 .bashrc 对您的工作有重要的内容,请创建一个包含内容的文件,例如 .bashrc.emacs
source .bashrc
source .aliases
Run Code Online (Sandbox Code Playgroud)
--rcfile .bashrc.emacs 并在您的指令中指向该文件(setq)。
您在哪里定义别名?Ubuntu 的 .bashrc 读取 .bash_aliases,这也应该发生在非交互式 shell 上。
| 归档时间: |
|
| 查看次数: |
755 次 |
| 最近记录: |