prompts icon indicating copy to clipboard operation
prompts copied to clipboard

Problem with option multiselect in terminal VSCode

Open julioacontreras opened this issue 3 years ago • 5 comments

Describe the bug

When select a option the bug screen.

To Reproduce

  1. index.js
const prompts = require('prompts')
prompts([
  {
    type: 'multiselect',
    name: 'color',
    message: 'Pick colors',
    choices: [
      { title: 'Red', value: '#ff0000' },
      { title: 'Green', value: '#00ff00' },
      { title: 'Blue', value: '#0000ff' }
    ]
  }
])
  1. node index.js

  2. Execute en click space in some option to bug.

System

  • OS: Windows 10
  • node v14.15.4
  • terminal VSCode

Thanks! )

julioacontreras avatar Jan 30 '21 18:01 julioacontreras

For me too...

lucasltv avatar Jan 31 '21 05:01 lucasltv

Interesting! Is there a stack trace you can paste, or is there a crash in VSCode itself?

FWIW, on macOS 10.15, I cannot reproduce this issue using latest prompts (tried: node 12 & 14 on Terminal, node 12 & 14 within VSCode Terminal).

elliot-nelson avatar Feb 01 '21 15:02 elliot-nelson

You can see the issue here. As soon as I click space and select an item, the alignment goes off.

prompts-issue

jakobrosenberg avatar Mar 31 '21 17:03 jakobrosenberg

I still wasn't able to repro this unfortunately. Based on the screenshot, it doesn't look like prompts would be able to create this output (the whole terminal "window" is moving about 4.5 characters to the left). I wonder if you pressing SPACEBAR is triggering some other paging or scrolling mechanism inside VSCode and causing the entire terminal window to "scroll" 32 pixels or so to the right.

elliot-nelson avatar Apr 02 '21 14:04 elliot-nelson

@elliot-nelson I just checked right-arrow vs spacebar and it seems you're correct. It only happens with spacebar.

jakobrosenberg avatar Apr 06 '21 11:04 jakobrosenberg