qooxdoo-compiler icon indicating copy to clipboard operation
qooxdoo-compiler copied to clipboard

Add qx create option to avoid all cursor control

Open derrell opened this issue 6 years ago • 7 comments

At present, the wizard for qx create attempts to overwrite each question on the screen with the next question, i.e., there are a lot of cursor control commands being written to the screen. It would be nice to have an option that eliminated all of the cursor control output so that the wizard would work nicely on a dumb terminal (or in an emacs shell). With this option enabled, each question would appear on a line, the user would respond and press Enter, which would move the cursor to the next line where the subsequent question would be presented.

derrell avatar May 14 '18 14:05 derrell

Looks like inquirer, the npm library that we use for user interaction, doesn't provide any option for nicely degrading on dumb terminals. Need to do some research on alternatives that have better dumb terminal support, maybe one of the following?

  • https://www.npmjs.com/package/promptly
  • https://www.npmjs.com/package/prompts
  • https://www.npmjs.com/package/readline-sync
  • https://www.npmjs.com/package/prompt-sync
  • https://www.npmjs.com/package/enquirer

cboulanger avatar May 14 '18 16:05 cboulanger

Surely it would be easy to just write an ask() method that decides whether to use cursor based or readline?

johnspackman avatar May 15 '18 06:05 johnspackman

Yes, but we have multiple-choice questions that would need to be manually translated into simple prompts, which is a chore I'd rather avoid :-). A more abstracted library would be my weapon of choice. But if I don't find one, we go with readlines...

cboulanger avatar May 15 '18 11:05 cboulanger

how about just picking the default if the thing is called without cursor control ... I guess the answers can be supplied on the commandline too

oetiker avatar May 16 '18 12:05 oetiker

@oetiker Yes, you always have the option to supply all information via CLI parameters. But I think @derrell wants the interactivity without the cursor control :-)

cboulanger avatar May 16 '18 12:05 cboulanger

@derrell Is this still a problem that seriously affects your workflow? Or is the CLI params option enough for your needs?

cboulanger avatar Dec 20 '19 12:12 cboulanger

qx create is used infrequently enough that if it's a huge amount of work to implement this, it's reasonable for the user (me, in this case) to open up a separate window (outside of emacs) to run the command. OTOH, I don't know that I've seen many other apps that do cursor control that don't provide a means of disabling it. From my perspective, this certainly need not be a blocker to first release, but should be "fixed" eventually rather than being closed.

derrell avatar Dec 20 '19 13:12 derrell