nushell / nushell/nushell

Pasting long command prints it in 1204 character increments

Open
#8,024 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A:line-editor
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

Describe the bug

Pasting a long command into the shell renders the first 1204 characters. Every subsequent key press will render the next 1204 characters until the command is rendered completely. The key presses are still handled though -- if you press Enter, you will see the next 1204 characters of your input, but the full command will already run, you just won't see it until you input enough key presses to get to the end.

How to reproduce
  1. Copy some long text, i.e.
    amet mattis vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac ut consequat semper viverra nam libero justo laoreet sit amet cursus sit amet dictum sit amet justo donec enim diam vulputate ut pharetra sit amet aliquam id diam maecenas ultricies mi eget mauris pharetra et ultrices neque ornare aenean euismod elementum nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo nec ultrices dui sapien eget mi proin sed libero enim sed faucibus turpis in eu mi bibendum neque egestas congue quisque egestas diam in arcu cursus euismod quis viverra nibh cras pulvinar mattis nunc sed blandit libero volutpat sed cras ornare arcu dui vivamus arcu felis bibendum ut tristique et egestas quis ipsum suspendisse ultrices gravida dictum fusce ut placerat orci nulla pellentesque dignissim enim sit amet venenatis urna cursus eget nunc scelerisque viverra mauris in aliquam sem fringilla ut morbi tincidunt augue interdum velit euismod in pellentesque massa placerat duis ultricies lacus sed turpis tincidunt id aliquet risus feugiat in ante metus dictum at tempor commodo ullamcorper a lacus vestibulum sed arcu non odio euismod lacinia at quis risus sed vulputate odio ut enim blandit volutpat maecenas volutpat blandit aliquam etiam erat velit scelerisque in dictum non consectetur a erat nam at lectus urna duis convallis convallis tellus id interdum velit laoreet id donec ultrices tincidunt arcu non sodales neque sodales ut etiam sit amet nisl purus in mollis nunc sed id semper risus in hendrerit gravida rutrum quisque non tellus orci ac auctor augue mauris augue neque gravida in fermentum et sollicitudin ac orci phasellus egestas tellus rutrum tellus pellentesque eu tincidunt tortor aliquam nulla facilisi cras fermentum odio eu feugiat pretium nibh ipsum consequat nisl vel pretium lectus quam id leo in vitae turpis massa sed elementum tempus egestas sed sed risus pretium quam vulputate dignissim suspendisse in est ante in nibh mauris cursus mattis molestie a iaculis at erat pellentesque adipiscing commodo elit at imperdiet dui accumsan sit amet nulla facilisi morbi tempus iaculis urna id volutpat lacus laoreet non curabitur gravida arcu ac tortor dignissim convallis aenean et tortor at risus viverra adipiscing at in tellus integer feugiat scelerisque varius morbi enim nunc faucibus a pellentesque sit amet porttitor eget dolor morbi non arcu risus quis varius quam quisque id diam vel quam elementum pulvinar etiam non quam lacus suspendisse faucibus interdum posuere lorem ipsum
    
  2. Try to paste it into nushell
  3. You will see the first 1204 characters, on the next key press you will see the next 1204 characters, and so on
Expected behavior

The entire pasted command is visible immediately.

Screenshots

No response

Configuration
key value
version 0.75.0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.67.0 (fc594f156 2023-01-24)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.67.0 (8ecd4f20a 2023-01-10)
pkg_version 0.75.0
build_time 2023-02-09 15:10:05 -08:00
build_rust_channel release
features database, default, trash, which, zip
installed_plugins
Additional context

I ran into this while pasting long ffmpeg commands (automatically-generated). The fact that the command runs on Enter even before it's fully visible is extra confusing and dangerous -- especially considering nushell has some differences in parsing, meaning you want to double-check the syntax highlighting on the whole command to avoid surprises.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in nushell 0.75.0 with the long pasted text described above, then trace the shell's input and terminal-rendering path to find why output is revealed in 1204-character increments. Done means the entire pasted command is visible immediately and pressing Enter does not run a command whose full input is still hidden.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.