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

Cursor Style using conemu-cyg-64.exe #573

Closed
cheuer opened this issue Mar 11, 2016 · 16 comments
Closed

Cursor Style using conemu-cyg-64.exe #573

cheuer opened this issue Mar 11, 2016 · 16 comments

Comments

@cheuer
Copy link

cheuer commented Mar 11, 2016

I recently set up the cygwin terminal connector (connector version 0.74, ConEmu version 160310) to get better color support, and I noticed that my cursor in vim (both locally and over SSH) wasn't changing to block mode. It looks like the connector doesn't support the cursor style escape sequences that cygwin bash does.

These two commands should switch the cursor to blinking block and blinking bar, respectively:

echo -ne "\e[1 q"
echo -ne "\e[5 q"

Both of the above work using bash, but when using the connector it just stays as the cursor I specified in the settings. Here are the task commands I am using for each:

set CHERE_INVOKING=1 & C:\cygwin\bin\bash.exe --login -i
set CHERE_INVOKING=1 & C:\cygwin\bin\conemu-cyg-64.exe

Here is the spec for the escape sequences, taken from http://invisible-island.net/xterm/ctlseqs/ctlseqs.html:

CSI Ps SP q
          Set cursor style (DECSCUSR, VT520).
            Ps = 0  -> blinking block.
            Ps = 1  -> blinking block (default).
            Ps = 2  -> steady block.
            Ps = 3  -> blinking underline.
            Ps = 4  -> steady underline.
            Ps = 5  -> blinking bar (xterm).
            Ps = 6  -> steady bar (xterm).

For what it's worth, it looks like bash only supports 1 and 5 from that list. If I echo 0-2 it does blinking block, and 3-6 do a blinking bar. It would be great if you could add support for these two in the cygwin connector.

@austinwagner
Copy link

With the new Linux Subsystem I would also like to see ConEmu support these, including the extended xterm options.

@Maximus5
Copy link
Owner

@austinwagner You've chosen wrong place for feature request!

You have to force Microsoft to do WSL<->console interactions in user mode! Until they are processed in kernel internally - they utterly limit ConEmu abilities!!

@austinwagner
Copy link

@Maximus5 I thought the escape codes were passed through to the terminal. Doesn't the new version of the default command prompt host interpret ANSI SGR escape codes itself?

@Maximus5
Copy link
Owner

@austinwagner Regardless the fact Win10 console interprets ANSI itself, WSL subsystem is working in the kernel, it does not write anything to console at all. Complain to MS about it!

@austinwagner
Copy link

"Complained" in the feedback hub application. I doubt they'll ever read a piece of feedback with no votes on it, but one can hope...

@Maximus5
Copy link
Owner

Maximus5 commented May 20, 2016

I doubt a lot in "hub" effect.
Perhaps, project site is much better :D

[https://github.com/Microsoft/BashOnWindows/issues?utf8=✓&q=is:issue is:open ConEmu](https://github.com/Microsoft/BashOnWindows/issues?utf8=✓&q=is:issue is:open ConEmu)

@austinwagner
Copy link

@Maximus5 My Google skills are shamed. I tried and failed to find a better place to submit my feedback.

Maximus5 added a commit that referenced this issue May 23, 2016
~~~
CSI Ps SP q - Set cursor style (DECSCUSR, VT520).
		Ps = 0  -> ConEmu's default.
		Ps = 1  -> blinking block.
		Ps = 2  -> steady block.
		Ps = 3  -> blinking underline.
		Ps = 4  -> steady underline.
		Ps = 5  -> blinking bar (xterm).
		Ps = 6  -> steady bar (xterm).
~~~
@cheuer
Copy link
Author

cheuer commented May 23, 2016

Just updated to build 160522 and tested out the cursor escape sequences, it's working exactly as expected, thanks!

@Kyshtynbai
Copy link

I'm afraid I am facing this issue again. Windos 10 + WSL + 180131 alpha conemu build

@Maximus5
Copy link
Owner

Maximus5 commented Feb 2, 2018

@Kyshtynbai HOW do you ru WSL?

@Kyshtynbai
Copy link

Kyshtynbai commented Feb 2, 2018

@Maximus5
My reply was not full enough. Fixing it:
After the instalation of ConEmu, it has created a task for WSL automatically. This version of the task had the issues with cursor in vim, like no selection in visual blocks, or non-functioning incsearch.

I re-wrote the command for the task according to the related manual on ConEmu site and the problem has gone -- now visual blocks, incremantal search highliting and so on works fine.

The only thing that still does not work is the same identical cursor both in command and insert mode of vim, but I think I can get on with it.

@Maximus5
Copy link
Owner

Maximus5 commented Feb 2, 2018

ConEmu creates proper task for WSL. You don't have to change it.
Without explicit examples your description is still unclear.

@Kyshtynbai
Copy link

Kyshtynbai commented Feb 2, 2018

Okay, I'll try to make an example

  1. This is a default task, created by ConEmu:
    %windir%\system32\bash.exe -cur_console:pm:/mnt
    Consoles, created with this task, show issues I've desribed, let's see in on a screenshot of a vim with incsearch process:
    http://i100.fastpic.ru/big/2018/0202/5b/e5ea35880007495f3243132a7f8cc35b.png
    No incsearch highlight.

  2. This is manualy added task:
    set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pnm:/mnt -t bash -l
    (I also added path to custom icon in the parametres string, I dont post it here)
    and here is a screenshot with the same attepmpt, as described above:
    http://i102.fastpic.ru/big/2018/0202/64/18cc337a89c214a8f0b88b056eb79864.png
    Incremental search highlight works ok.

And in both cases cursor it the same in command and insert mode.

@Maximus5
Copy link
Owner

Maximus5 commented Feb 2, 2018

Nope.

%windir%\system32\bash.exe -cur_console:pm:/mnt

This is not the actual default task. Read this:
https://conemu.github.io/en/Tasks.html#add-default-tasks

If course you will have issues with WSL running it using inappropriate way.

As for the problem running WSL from proper task via connector... Have you tried it without ConEmu?

@Kyshtynbai
Copy link

Kyshtynbai commented Feb 2, 2018

As for the problem running WSL from proper task via connector... Have you tried it without ConEmu?

I've tried it just now and it seens everything works OK (like with the running WSL from proper task), but the cursor in vim still does not change depeding on command/insert mode.
It looks like this problem is not in ConEmu. Other issues are solved by running a proper task. Thank you.

@ChasonDeshotel
Copy link

Looks like Microsoft fixed this March 20th. Limited to Insider builds for now. Source: microsoft/terminal#68

So with an Insider build of Windows, this will work:

let &t_SI.="\e[5 q"
let &t_SR.="\e[4 q"
let &t_EI.="\e[1 q"

I'm not sure if they fixed the root issue of not passing ReadConsole state or if they're just fixed the escape sequences. Either way, this is a workaround that can be added to the ConEmu docs: https://conemu.github.io/en/MicrosoftBugs.html#Insert-Overwrite-Indicator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants