Skip to content
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 will start with some messages #1907

Closed
c02y opened this issue Jan 20, 2015 · 7 comments
Closed

fish in emacs will start with some messages #1907

c02y opened this issue Jan 20, 2015 · 7 comments

Comments

@c02y
Copy link

c02y commented Jan 20, 2015

When I use shell (not eshell or ansi-term or term) in Emacs, it will execute fish as shell,

1). it will definitely start with these messages in the shell buffer:

 ^[]0;fish  /home/chz^Gbind: Key with name “down” does not have any mapping
 bind: Key with name “up” does not have any mapping
 bind: Key with name “right” does not have any mapping
 bind: Key with name “left” does not have any mapping
 bind: Key with name “dc” does not have any mapping
 bind: Key with name “backspace” does not have any mapping
 bind: Key with name “ppage” does not have any mapping
 bind: Key with name “npage” does not have any mapping

2). And every time I run a command (such as ls) in it, it will insert a message at the beginning of the output:

^[]0;ls  /home/chz/dir^Gfile1 file2 ...

3). Every time I run a command (such as ls or even just Enter), it will list double lines of chz@localhost ~> ls or chz@localhost ~> then the output of the commands.

These all will happen whether or not my config.fish file is empty ( I remove all ~/.config/fish away).

@zanchey
Copy link
Member

zanchey commented Jan 21, 2015

What version are you running? #1155 covers the first problems but is not in a released version.

What does echo $TERM output?

@c02y
Copy link
Author

c02y commented Jan 21, 2015

# in terminal:
$ echo $TERM
xterm-256color
$ fish --version 
fish, version 2.1.1

# in shell of Emacs
$ echo $TERM
^[�]0;echo  /home/chz�^Gdumb

According to 7d34501, I edited /usr/share/fish/functions/__fish_config_interactive.fish manually, the first problem is solved.

@zanchey
Copy link
Member

zanchey commented Jan 22, 2015

OK, this looks like an attempt to write the window title to a terminal which doesn't support it. The heuristic for working out whether to write the title is not fantastic - the dumb terminal type should probably be added.

In the meantime, you can work around with something like this in your config.fish:

if test "$TERM" = "dumb"
    function fish_title; end
end

@zanchey zanchey added this to the next-major milestone Jan 22, 2015
@c02y
Copy link
Author

c02y commented Jan 22, 2015

OK, not the ^[]0;fish /home/chz^G in every command's output is gone, the 2nd problem is solved.

The 3rd problem is still there. Any clue about the double lines?

@zanchey
Copy link
Member

zanchey commented Jan 23, 2015

That might be #1411.

@c02y
Copy link
Author

c02y commented Jan 23, 2015

No, according to #1411, fish in ansi-term prints an extra "⏎", but as I said at the first beginning of this post, I'm using shell not ansi-term or eshell or term in Emacs, and there isn't any extra "⏎" in the output of commands in my shell, actually the extra "⏎" symbol and other extra abnormal messages exist in my ansi-term too, but I do not use it, so here my problem is in shell of Emacs.

Let me list some examples of this problem:

# this is my original text in the shell in Emacs, note that my prompt is in the second line, `|` is my cursor
chz@localhost: ~/Projects/Go/exercism-cli 
➤➤ |

# if I type `Enter` key at `|` symbol, it will be (including the original text):
chz@localhost: ~/Projects/Go/exercism-cli 
➤➤ 
chz@localhost: ~/Projects/Go/exercism-cli 
➤➤
chz@localhost: ~/Projects/Go/exercism-cli 
➤➤ |

# if I type ls after the original text, it will be (including the original text):
chz@localhost: ~/Projects/Go/exercism-cli 
➤➤ ls
chz@localhost: ~/Projects/Go/exercism-cli 
chz@localhost: ~/Projects/Go/exercism-cli 
➤➤ ls
cli/  README
chz@localhost: ~/Projects/Go/exercism-cli 
➤➤ |

NOTE:
I created a new issue, please go to #1913 since this problem is far from original post's title.

@zanchey
Copy link
Member

zanchey commented Feb 2, 2015

Leaving this open to track the second problem.

@zanchey zanchey modified the milestones: next-minor, next-major Feb 2, 2015
@zanchey zanchey closed this as completed in 981a715 Feb 2, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants