bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Escape sequences in vi-ins-mode-string


From: Joshua O'Connor
Subject: Escape sequences in vi-ins-mode-string
Date: Tue, 23 Apr 2019 20:54:17 +0100
User-agent: NeoMutt/20180716

Hi,

I'm trying to have my cursor change within Bash depending on the vi mode I'm in.
To accomplish this I've used:
        > vi-ins-mode-string = "\1\e[6 q\2"
and a corresponding vi-cmd-mode-string in .inputrc, which has indeed worked.

However when using the tmux terminal multiplexer it fails to work, with
similar behaviour in vim.
>From reading online it appears one must wrap such escape sequences inside a
tmux escape sequence to pass it through
        > \ePtmux;\e ..... \e\\
where ..... represents the escape sequence to be passed.

Using this method does indeed fix vim, and it does indeed in Bash too,
which suggests something is happening.
However a new issue arises, when scrolling up in the bash history, some
characters become "stuck" and remain displayed despite the actual text not
being there any longer.

This behaviour seems to be well known, and is usually resolved by correctly
escaping out zero-width characters in one's PS1 prompt with \[ and \].

Unfortunately I've had no such luck using this technique within my .inputrc
, which leads me to my question: Is escaping these zero-width characters
done differently within .inputrc?

I've asked on tmux's bug reporting system to find out more information on
this wrapper sequence(https://github.com/tmux/tmux/issues/1684), however
since it appears to be working I suspect it's just an issue of correctly
escaping the vi-cmd-mode-string once it's passed through(? I'm not exactly
sure of this mechanism) to the prompt.

Thanks,
        Joshua



reply via email to

[Prev in Thread] Current Thread [Next in Thread]