Feature Request: Show character under cursor when cursorShape is set to filledBox
Summary of the new feature/enhancement
When cursorShape is set to filledBox, it hides the character under it:
(The command is cat /etc/os-release)
This is a bit annoying. It will be helpful if the character can still be visible when the cursor is moved to its position.
It's a good idea. Naively doing this will break up ligatures under the cursor, but perhaps that is desirable!
As a big Vim user this one is annoying me enough that I've had to switch to Hyper. Raised an issue in #3241 but closed it in favour of this one. Otherwise everything worked pretty great!
Adding to this discussion from #3322, since we should probably include all these scenarios:
- Someone might want the current behavior (for some reason)
- someone might want the character to appear on top of the cursor, in the character's FG color
- someone might want the character to appear in the character's BG color, on top of the cursor (which is drawn in
cursorColor)
Also relevant: #1356, which tracks a similar request in conhost (not the terminal).
Configuration of this will be great, but the most important and easy fix for now would be to just display the underlying character negative. That will make it at the very least usable, until the added configuration is implemented.
Maybe allowing to change the cursor opacity can be a solution for now?
I'd like something along the lines of cursorForegroundColor, defined in colorschemes/profiles, describing the color of the character under the cursor as a complement to the existing cursorColor.
For those frustrated vim users, changing OPACITY_OPAQUE to 0x7F000000 should somewhat mitigate this issue. Drawing the character on top of the cursor might be a better solution but it doesn't seems trivial.
https://github.com/microsoft/terminal/blob/64ac0d25e04834391598775f3aced6856cb59257/src/renderer/dx/DxRenderer.cpp#L1454
For those frustrated vim users, changing
OPACITY_OPAQUEto0x7F000000should somewhat mitigate this issue. Drawing the character on top of the cursor might be a better solution but it doesn't seems trivial. https://github.com/microsoft/terminal/blob/64ac0d25e04834391598775f3aced6856cb59257/src/renderer/dx/DxRenderer.cpp#L1454

Notes from @nj-ms:
Description of the new feature/enhancement
Unless I'm mistaken, Windows Terminal configuration supports just the
cursorColorsetting, which functions as if I've set both the foreground and background colors to the same color. Other terminal programs (Alacritty, ..., ?) support configuration of the cursor foreground color and the cursor background color, and/or they respect the foreground color setting and the character shows through the cursor. For example, I'd like to set the background to black (#000000), foreground to white (#ffffff), the cursor background to magenta (#990099) and the cursor foreground to white (#ffffff). This way, I can still see the character under the cursor. This is especially annoying, for example, if I'm in a Linux WSL and vim'ing a file. This modification is also important in relation to #1379.Proposed technical implementation details
- Make the current
cursorColorsetting continue to set both foreground and background colors.- Add a
cursorBackgroundsetting to set just the background color; should usecursorColorby default.- Add a
cursorForegroundsetting to set just the foreground color; should useforegroundand/orcursorColorby default. It might also work to just use theforegroundcolor and make the character show through the cursor, with the drawback that it's slightly less configurable.
Can we just reverse the foreground and the background color of the text under cursor like what gVim does?

@DHowett-MSFT Is there any chance we can get the simple case fix that multiple people have suggest above?
Yes, it would be great if this could be configured and what not, but I think there's a large group of Terminal users who would just be thankful for a basic fix as outlined above https://github.com/microsoft/terminal/issues/1203#issuecomment-598002624.
If it were trivially possible with our renderer set up the way it is, I'd say yes. This close to our signoff date, though, I'm a bit concerned about that. ☹️
@DHowett-MSFT I'm not sure I understand.
In the comment I linked to a solution is presented that requires changing one flag in an existing call from OPACITY_OPAQUE to 0x7F000000: https://github.com/microsoft/terminal/blob/64ac0d25e04834391598775f3aced6856cb59257/src/renderer/dx/DxRenderer.cpp#L1454
While not perfect, the change seems to involve changing 14 characters, and it seems to at least let the character be seen in most cases. Others have confirmed this above.
Maybe I'm completely misunderstanding, but this seems like the literal definition of a trivial change that has useful impact today? If you want someone to PR it I'm happy to do so.
@DHowett-MSFT Just to clarify - I understand and appreciate what you're saying about being close to 1.0, and I really appreciate all of the work you and the team are doing for Terminal. If it wasn't for you folks and this project I'd still be stuck in the Apple ecosystem.
I think this is a bug, not a feature for console/tty/terminal. Need Make it usable before optimizing.

An illegible filled box is not a feature it's a bug. It's about the one thing I have found problematic with Windows Terminal; in general Terminal has been well behaved and the configuration capability was a delight to discover.
A number of color terminals allow end-applications to set colors independently - vim is an example, when paired with the right terminal. That's probably a feature set too much to ask for, so being able to tune the FG/BG colors would be enough. Some of us can't live without our filled boxes - they make spotting location much easier in a big page of text. Granted the opaque ones fill that need but seeing the character underneath is a must-half. Cheers.
I consider this a bug, all characters on screen should be legible. Also this is not even a problem in the basic cmd terminal. The behavior Windows terminal currently shows for this does not exist in any other Windows, Linux or Mac terminals i have seen.
I would like to start by saying that the overall experience of the terminal from installing in the Microsoft Store to the tabs all are wonderful but this is a serious issue that ruins the entire WSL experience. There is no way for someone to practically use the terminal with editor like vim/neovim/gvim. I am disappointed that this has been open for almost a year now, I do not feel this is getting the response from the maintainers. With great regret, I am going to have to switch to another open-source terminal, hopefully, this will get resolved quickly so I can return to this wonderful terminal.
I am disappointed that this has been open for almost a year now, I do not feel this is getting the response from the maintainers
https://github.com/microsoft/terminal/issues/1203#issuecomment-622045617 DHowett-MSFT 21 days ago
We're pretty actively looking into it. It's unfortunately not trivial to just implement, because the right solution isn't just "paint the cursor at half opacity". I'd rather not stick in the wrong behavior temporarily while we're working on the right behavior.
The real problem here is that the cursor is drawn in our renderer after the text is, so it's always painted on top. @DHowett and I discussed a bunch of options here, but none of them were trivial changes to sneak in right before a major release.
Now that we're past 1.0, we'll be coming back to see which of the options we discussed is the best. Hence why it's on our "v1.x" milestone, the generic "we want to get to this ASAP after 1.0" milestone.
@zadjii-msft Appreciate the thought and effort you and @DHowett and the rest of the team are putting towards this issue.
That said and by way of explanation of why we're being so annoying about this issue, I don't think anyone in this thread proposed the 0x7f hack as the right behaviour, simply that it would be implementing a working fix today over something that is completely broken.
Maybe you don't encounter this frustration because y'all are using VSCode as your daily drivers - but for the large contingent of terminal based editor users out there this bug is frustrating on a daily basis, and that's why we'd push for a working but temporary fix today over a perfect and right fix however many more months away.
To add some personal context, now that Apple have fixed their atrocious keyboards this year, I'm considering moving back to OSX because it would remove this daily and constant source of frustration as I try to work everyday. That's how annoying I find this issue.
EDIT: And I am particularly galled by this whole thing when I think about the fact I can turn on retro-style CRT effects, which literally no one asked for, but I can't reliably edit text in Vim.