💾 Archived View for pwshnotes.flounder.online › gemlog › 2022-08-15-sticky-scroll.gmi captured on 2024-06-16 at 12:21:49. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-12-28)

-=-=-=-=-=-=-

VS Code Sticky Scroll

VS Code version 1.70 added the feature "sticky scroll".

settings.json:

{
    "editor.stickyScroll.enabled": true
}

This allows the declaration for a code block to stay in view while scrolling vertically: similar to frozen rows in Excel.

An animated demonstration appears in the announcement.

Sticky Scroll in Trees

VS Code version 1.85 added the preview feature "Sticky Scroll in Trees".

settings.json:

{
    "workbench.tree.enableStickyScroll": true
    "workbench.tree.stickyScrollMaxItemCount": 7
}

This takes the sticky scroll behavior from the editor window and applies it to tree views like a folder tree in the Explorer panel.

Terminal Sticky Scroll

VS Code version 1.85 also added sticky scroll for the terminal.

Sticky scroll for the terminal requires the VS Code shell integration. See the "Terminal" section in the v1.85 update notes.

settings.json:

{
    "terminal.integrated.stickyScroll.enabled": true
}

In the terminal, sticky scroll shows the last command while you scroll through output.

Further down, the patch notes read:

[Shell integration] will also trim empty lines from the top of the prompt, commonly used to split up output and make the terminal easier to read.

This makes sense. If you have a custom prompt, you don't have to change it. And, inside VS Code, the shell integration will detect blank lines at the top of the terminal and replace them with the sticky scroll visual. If it didn't do this, you would have two or three blank lines pinned to the top of the terminal and wasting space.

References

Sticky Scroll Announcement

Sticky Scroll | Released Feature

Visual Studio Code v1.85

FYI: Freeze columns or rows in Microsoft Excel | YouTube

Created: Monday, August 15, 2022

Updated: Tuesday, December 19, 2023