Skip to content

feat: add bottom margin support for reserving terminal space#1037

Closed
brancengregory wants to merge 1 commit intonushell:mainfrom
brancengregory:bottom-margin
Closed

feat: add bottom margin support for reserving terminal space#1037
brancengregory wants to merge 1 commit intonushell:mainfrom
brancengregory:bottom-margin

Conversation

@brancengregory
Copy link
Copy Markdown

  • Add BottomMargin enum with Fixed and Proportional variants to reserve space at the bottom of the terminal for completion menus and hints.
  • The margin is 'soft' - gracefully handles small screens by reducing to 0 rather than erroring.
let editor = Reedline::create()
  .with_bottom_margin(BottomMargin::Fixed(5))  // 5 lines
  .with_bottom_margin(BottomMargin::Proportional(0.3)); // 30% of screen

Defaults to BottomMargin::Fixed(0), i.e. no change in behavior, backwards compatible

Closes #1036

- Add BottomMargin enum with Fixed and Proportional variants to reserve
space at the bottom of the terminal for completion menus and hints.
- The margin is 'soft' - gracefully handles small screens by reducing
to 0 rather than erroring.

Usage:
  .with_bottom_margin(BottomMargin::Fixed(5))
  .with_bottom_margin(BottomMargin::Proportional(0.3))

Closes nushell#1036
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

Successfully merging this pull request may close these issues.

Add bottom margin support for reserving terminal space (like prompt_toolkit's bottom margin)

1 participant