怎样才可以有term.el(ANSI期)跟踪的目录,如果使用的不是bash的其他anyhting [英] How can I have term.el (ansi-term) track directories if using anyhting other than bash

查看:201
本文介绍了怎样才可以有term.el(ANSI期)跟踪的目录,如果使用的不是bash的其他anyhting的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这取决于你在什么目录使用ESHELL或ANSI长期和bash的Emacs更改默认的目录变量。

When using eshell or ansi-term and bash emacs changes the default-directory variable depending on what directory you are in.

所以,如果我移动到 /家庭/用户/ code /项目键,然后用IDO找到的文件打开一个文件时,它开始IDO与CWD 。如果我用KSH(我正常的shell)或zsh的(试过用于测试)它不工作。有没有设置或者这只是在bash支持?

So if I move to /home/user/code/project and then use ido-find-file to open a file it starts ido with the CWD. If I use ksh (my normal shell) or zsh (tried for testing) it doesnt work. Is there a setting or is this just supported under bash?

感谢

推荐答案

将这个:

chpwd() { print -P "\033AnSiTc %d" }

print -P "\033AnSiTu %n"
print -P "\033AnSiTc %d"

该chpwd()函数运行每次PWD变化。在%d结束行是一个允许你跟踪当前目录 - 我再说一遍函数外,以确保当zsh中首先初始化运行它。但Emacs的要求我们先告诉它当前用户是谁(该线在%N结尾)。

The chpwd() function is run every time the pwd changes. The line ending in %d is the one that allows you to track the current directory--I repeat it outside the function to make sure it is run when zsh first initializes. But Emacs requires us to first tell it who the current user is (the line ending in %n).

这实际上是在term.el解释说,这应该是里面的/ usr /共享/ emacs的//口齿不清,如果你使用的Ubuntu。

This is actually explained in term.el, which should be inside /usr/share/emacs//lisp, if you're using Ubuntu.

希望这有助于。

这篇关于怎样才可以有term.el(ANSI期)跟踪的目录,如果使用的不是bash的其他anyhting的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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