Skip to content

Move save & restore logic inside Show-Menu #19

@ElianFabian

Description

@ElianFabian

Currently, as mentioned in the README file, we have to manually save and restore the cursor position. This can be streamlined by incorporating that logic directly into the Show-Menu function. Below is an example of how the code can be changed:

# Before
If ($Callback) {
    & $Callback

    Start-Sleep -Milliseconds 10
}
# After
If ($Callback) {
    $lastTop = [Console]::CursorTop
    & $Callback
    [System.Console]::SetCursorPosition(0, $lastTop)
    Start-Sleep -Milliseconds 10
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions