Skip to content

Long working directory path hides or overlaps the Console pane's buttons #19785

Description

@gtritchie

When the Console pane has no other tabs (Terminal and Background Jobs closed), a long working directory path in the Console title bar draws over the pane's Clear Console, Minimize, and Restore/Maximize buttons. The "View the current working directory" button after the path is pushed past the pane's right edge.

Steps to reproduce

  1. Close the Terminal and Background Jobs tabs, so Console is the only tab in its pane.
  2. In the Console, setwd() to a long path, e.g. a directory nested 10 or more levels deep.
  3. Narrow the Console pane until the path no longer fits.

Measured in Chromium on RStudio Server (current main), with a 553px-wide Console pane: the path text spans x=107–617, over Clear Console (480–500), Minimize (513–527), and Restore (531–545). The working directory button is at 621–641, outside the pane. At a medium width, before the path reaches the frame buttons, the working directory button and Clear Console overlap each other.

With other tabs open

When the Console pane has other tabs (e.g. Terminal), the path is in the Console toolbar below the tabs, and a long path pushes the toolbar's buttons out of view instead.

  1. Open a Terminal, so the Console pane has Console and Terminal tabs, and select the Console tab.
  2. setwd() to a long path, as above.

Measured in Chromium on RStudio Server, with a 406px-wide Console pane (x=9-415): the toolbar is 1184px wide (9-1193), the path spans 109-1127, and the working directory button (1127-1147), Find in Console (1151-1165), and Clear Console (1169-1189) are all past the pane's right edge, where they're clipped.

The Terminal toolbar has the same problem: its title, which is usually the terminal's working directory, pushes its buttons out of view. Measured with a 512px-wide pane (x=9-521): the toolbar is 1204px wide (9-1213), the title spans 158-1176, and Clear terminal and Close current terminal session (1176-1213) are past the pane's right edge. It appears when the terminal's title changes to a long directory, e.g. on opening a Terminal (View > Move Focus to Terminal) while R's working directory is a long path.

Cause

No other tabs: WindowFrame keeps the title bar's right end clear of the frame buttons when it places the header. In console-only mode, this rule in themeStyles.css (line 1173) overrides that with right: 0px !important, so the header spans the full pane width:

.windowFrameObject.consoleOnlyWindowFrame div.consoleHeaderLayout {
   left: 0px !important;
   top: 0px !important;
   right: 0px !important;
   bottom: 0px !important;
}

The path label also has no truncation (overflow: visible), so it draws past the header's edge.

With other tabs: Toolbar, used by both the Console and Terminal toolbars, lays out its widgets in tables, which grow to fit their contents, so the toolbar becomes wider than the pane and the pane clips its right end.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions