Fish-shell: Autocompletion overwrites previous output in Terminal.app

Created on 10 Nov 2017  ·  3Comments  ·  Source: fish-shell/fish-shell

Thank you everyone who works on fish, this is most sane shell which finally got me to script stuff ❤️

What's Wrong

When I hit TAB, if autocomplete stuff "does not fit" (e.g. more lines than left in terminal viewport), it overwrites stuff from first line, not the line where cursor was. Same behaviour in folowing situations as well:

  • right after brew install fish;
  • with sh -c 'env HOME=$(mktemp -d) fish' after some customization (mostly functions and env exports);
  • on a fresh ubuntu mini install (I sshed from Terminal.app and installed fish from your PPA).

Terminal.app

I expect this to be an issue with Termnial.app, maybe I have to toggle some setting? I tried guessing and was toggling Paste newlines as carriage returns with no success. Here are what I currently have:


Screenshots of my Terminal.app settings
screenshot 2017-11-10 20 49 00

screenshot 2017-11-10 20 48 38



Video

Idk how better explain, so here's a video:

https://youtu.be/qb-3042lXO0


Versions

# fish --version; and echo $version
fish, version 2.6.0
2.6.0

# fish was instealld from brew, so maybe this helps as well
# brew info fish
fish: stable 2.6.0 (bottled)
Poured from bottle on 2017-11-08 at 17:21:24

# uname -a
Darwin elmacbook 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

# TERM stuff from env
TERM=ansi
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=400
question

Most helpful comment

Why are you setting your terminal as ansi? What happens if you use xterm-256color?

All 3 comments

Shell loaded:

screenshot 2017-11-10 20 56 37

I type git, Space, Tab, Tab, Tab, Control + C right after:

screenshot 2017-11-10 20 57 30

Notice how prompt (from before? printed twice?) is there and overwritten from line 1. Also, cursor at line 2, even though 3 lines are printed.

(I have two lines in my fish_prompt, but this happens with default one too, with empty string, with simple >, etc.)

Why are you setting your terminal as ansi? What happens if you use xterm-256color?

Oh my, thanks, @floam.

I've no idea, guess I accidentally scrolled it from default at some point. Not even sure what that setting is, but xterm-256color fixes the issue.

Was this page helpful?
0 / 5 - 0 ratings