Skip to content

Commit

Permalink
Interactive page size and hint how to quit (#1476)
Browse files Browse the repository at this point in the history
  • Loading branch information
edlerd authored Nov 12, 2024
1 parent 5b2aa84 commit 3027213
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/runLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,17 @@ const chooseUpgrades = async (
]
})

const optionsPerPage = process.stdout.rows
? Math.max(3, process.stdout.rows - INTERACTIVE_HINT.split('\n').length - 1 - groups.length * 2)
: 50

const response = await prompts({
choices: [...choices, { title: ' ', heading: true }],
hint: INTERACTIVE_HINT,
instructions: false,
message: 'Choose which packages to update',
name: 'value',
optionsPerPage: 50,
optionsPerPage,
type: 'multiselect',
onState: (state: any) => {
if (state.aborted) {
Expand All @@ -131,13 +135,17 @@ const chooseUpgrades = async (
selected: true,
}))

const optionsPerPage = process.stdout.rows
? Math.max(3, process.stdout.rows - INTERACTIVE_HINT.split('\n').length - 1)
: 50

const response = await prompts({
choices: [...choices, { title: ' ', heading: true }],
hint: INTERACTIVE_HINT + '\n',
instructions: false,
message: 'Choose which packages to update',
name: 'value',
optionsPerPage: 50,
optionsPerPage,
type: 'multiselect',
onState: (state: any) => {
if (state.aborted) {
Expand Down

0 comments on commit 3027213

Please sign in to comment.