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 Text Sync Issue in Console #2266

Closed
coatless opened this issue Feb 23, 2018 · 10 comments

Comments

Projects
None yet
4 participants
@coatless
Copy link

commented Feb 23, 2018

System details

RStudio Edition : Desktop
RStudio Version: 1.1.419
OS Version: CentOS 7 
R Version: v3.4.3 

Steps to reproduce the problem

  1. Open RStudio on CentOS 7
  2. Begin typing in the Console portion of RStudio
  3. Note that the cursor "lags" to a further point than where the text is.

rstudio-cursor-lag

Live:

eo16e-ref12

Describe the problem in detail

The cursor when typing in CentOS 7 unexpected becomes unsync'd with the text that is enabled. Switching the font away from Courier seems to resolve the issue.

Describe the behavior you expected

The cursor should be in-line with the font.


Is there anyway to set a font for multiple RStudio instances?

I've looked in:

~/.rstudio-desktop/monitored/user-settings/user-settings

But, there doesn't seem to be an editor-font option.

@ronblum

This comment has been minimized.

Copy link

commented Feb 23, 2018

I'm able to reproduce this with some fonts on CentOS 7.4 using RStudio Desktop 1.2.364, though not 1.1.423. These fonts have the problem: Clean, Courier, Cursor, and Fixed. Than you @coatless for the bug report!

@ronblum ronblum added the bug label Feb 23, 2018

@ronblum

This comment has been minimized.

Copy link

commented Mar 2, 2018

The issue just occurred for me on Mac using RStudio Desktop Pro 1.2.370-1. I haven't been able to find a specific reason for it.

@ronblum ronblum added this to the v1.2 milestone Mar 2, 2018

@coatless

This comment has been minimized.

Copy link
Author

commented Mar 2, 2018

One of our techs came up with an intermediary workaround for the font bug on CentOS 7. His fix was to set a font via a desktop.ini configuration and rolling it out to users in a ~/.bash_profile as there wasn't an option in ~/.rstudio-desktop/monitored/user-settings/user-settings.

  1. Create:
touch ~/.config/Rstudio/desktop.ini
  1. Enter into the file:
[General]
font.fixedWidth=Liberation Mono
@kevinushey

This comment has been minimized.

Copy link
Contributor

commented Mar 2, 2018

Normally, RStudio should only allow you to select monospaced fonts (as the editor instances used by RStudio only support monospaced fonts). How did you end up with Courier as your editor font? (Was it available as a font selection choice that was explicitly chosen, or was it selected through some other means?)

@coatless

This comment has been minimized.

Copy link
Author

commented Mar 2, 2018

@kevinushey the font was selected upon opening RStudio. It is still an explicit font choice under Code appearances. Here is the font list shown to the user:

img_1042

We've only now set a fixed font to Liberation Mono via the desktop.ini I've shown above.

@coatless

This comment has been minimized.

Copy link
Author

commented Mar 3, 2018

@kevinushey for the record, Courier is monospaced. c.f.

https://en.wikipedia.org/wiki/Courier_(typeface)

@kevinushey

This comment has been minimized.

Copy link
Contributor

commented Mar 15, 2018

With a plain installation of RStudio on a CentOS 7 box, I don't see this issue. In fact, I don't see the variants of Courier that you have installed, either:

screen shot 2018-03-15 at 3 00 13 pm

The 10 pitch Courier font does seem to render correctly in my case. I think in the images you show the font is not actually Courier; rather, RStudio is attempting to set that font but is perhaps failing to do so, and falling back to a non-monospace font.

@kevinushey

This comment has been minimized.

Copy link
Contributor

commented Mar 15, 2018

If I change to a font that doesn't exist, for example, changing the contents of ~/.config/RStudio/desktop.ini to contain the fictional font:

[General]
font.fixedWidth=Alien Samba

then the attempt to set a fixed-width font fails, and then the default serif font is used instead.

@coatless

This comment has been minimized.

Copy link
Author

commented Mar 15, 2018

Is there anyway that I could quickly determine the font RStudio is providing?

@kevinushey

This comment has been minimized.

Copy link
Contributor

commented Mar 15, 2018

If you right click on some text in the RStudio console history and click Inspect Element in the context menu, you should get a web inspector that shows you what styles are being applied to that text. I imagine you're seeing a font being applied that doesn't actually exist on your system, and so that is failing.

@dfalty dfalty added the verified label Nov 5, 2018

coatless added a commit to illinois-r/r-centos7-cbtf that referenced this issue Mar 15, 2019

Added a configuration file for RStudio
This configuration file changes the default
font family used by RStudio on load to prevent
a font spacing issue.

c.f.

rstudio/rstudio#2266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.