Skip to content

Unable to clear terminal inside command #14280

Closed
@redsuperbat

Description

Describe the bug

When clearing the terminal inside a custom command it does not clear the terminal.

How to reproduce

  1. Run this custom watch command
def watch [cmd: closure, dur?: duration] {
  clear
  loop {
    let result = do $cmd
    clear
    print $result
    sleep ($dur | default 2sec)
  }
}
  1. The first clear command does not clear the terminal

Expected behavior

I expected nu to clear the terminal

Configuration

key value
version 0.99.1
major 0
minor 99
patch 1
branch
commit_hash
build_os macos-aarch64
build_target aarch64-apple-darwin
rust_version rustc 1.81.0 (eeb90cda1 2024-09-04) (Homebrew)
cargo_version cargo 1.81.0
build_time 2024-10-20 02:45:05 +00:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash
installed_plugins

Metadata

Assignees

No one assigned

    Labels

    needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions