Skip to content

fish -c "complete -C" messes with terminal modes #8705

@krobelus

Description

@krobelus

Run

fish -c 'complete -C ": "' | sed 1q | vim -

sometimes vim ends up in a broken state: characters are echoed as I type them.

It does not happen if stdin is not a terminal:

echo | fish -c 'complete -C ": "' | sed 1q | vim -u NONE -

Looks like fish restores terminal modes, which overwrites any modes set by vim.

write(1, "\n", 1)                       = -1 EPIPE (Broken pipe)
--- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=1027314, si_uid=1000} ---
getpid()                                = 1027314
getpgrp()                               = 1027309
ioctl(0, TIOCGPGRP, [1027309])          = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0

Sort of related to #8699 - but the fix is probably different.
We can just not set any terminal modes in this scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions