New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fish in emacs' ansi-term has prompt issues #107
Comments
After I reported this, I happened to notice that this is documented in the original fish documentation, with the fix being: echo 'function fish_title;end' > ~/.config/fish/config.fish However, that doesn't work for me: Welcome to fish, the friendly interactive shell |
I have exactly the same problem but with iTerm. The 'fix' didn't work for me either. |
The above fix is close. Adding:
to ~/.config/fish/config.fish fixed it for me in Emacs 24.1 |
This is the one. |
+1 |
@akrito Thanks! This worked for me, too. |
The fish title hack is not working for me. There may be no title, but it is still changing the folder displayed in the tile (when viewed from iterm) |
@SlightlyCyborg: If you don't use the fish title thing, do you get the folder displayed twice (and only once with it)? If you use it on another terminal, does it work? iTerm has special integration with shells, and the fish version isn't conditional on the $TERM being iTerm, and it only blacklists screen. By default this file will be saved as |
@faho I only checked it on iterm (turns out it is just macs standard Terminal) to find out why I was still getting a strange line printed on emacs term every time I used cd
Yes, if I remove the fish_title from the config, then I will see the folder appear twice on the mac Terminal app. The same thing still happens in emacs term. |
@SlightlyCyborg: Run this: if test "$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal"
echo "True"
end Does it print "true"? In that case, this is our cwd reporting for VTE or Apple Terminal. Since you are running emacs in a terminal that can handle this, we're printing it, but emacs then mangles it so the term no longer gets the full sequence (yet another limitation of ansi-term). |
We might need to do what Apple does for Emacs:
# Working Directory
#
# Tell the terminal about the current working directory at each prompt.
if [ -z "$INSIDE_EMACS" ]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL, including
# the host name to disambiguate local vs. remote paths.
# Percent-encode the pathname.
local url_path=''
{
# Use LC_CTYPE=C to process text byte-by-byte. Ensure that
# LC_ALL isn't set, so it doesn't interfere https://gist.github.com/floam/f535842a16226e77d014d67bade2b2f3 |
I'm going to add the $INSIDE_EMACS check for the CWD OSC and define an empty fish_title if the user is using VTE/Terminal.app. The reasoning for the latter is that these modern terminals both compose a nicer title if we don't try to provide a custom one (no path in title twice, "fish" in title twice) - and the user can configure which components they'd like in their terminal inside the terminal preferences. |
I got tripped up by the iTerm shell integration. Could we mention that in the readme in the fish section, too? |
@rdrey: IIRC, iTerm ships that, so you'll have to take it up with them. |
Sorry, I was in the completely wrong repo last night. I thought I was commenting on an issue in https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Btools/shell. 😅 I've created a PR for iTerm2 instead. (gnachman/iterm2-website#35) |
Under emacs's ansi-term (probably the only way to get the real power of fish inside of emacs), the prompt looks like:
2;fish /home/ahyatt2;fish /home/ahyatt
ahyatt@ahyatt /home/ahyatt>
My term is eterm-color, which is standard for ansi-term. Probably some of the default ansi control sequences in the prompt are not quite kosher.
The text was updated successfully, but these errors were encountered: