pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

🐞 [Bug]: Starting up without an action always runs `init` which wipes any pre-existing configuratiuon

Open jim-counter opened this issue 2 years ago • 1 comments

What happened?

If I run the Simple CLI without any command line parameter e.g. farm, init' or wipe with the expectation I will be offered the menu of actions, the init activity is automatically run without any user input which wipes any pre-existing configuration and means I have to enter it all again.

PS C:\Users\jimco\Desktop\Subspace Simple CLI> ."C:\\Users\\jimco\\Desktop\\Subspace Simple CLI\\subspace-cli-windows-x86_64-skylake-v0.5.1-alpha-2.exe"
 Please select an option below using arrow keys (or `j` and `k`):

   > init
    farm
    wipe
    info
    open logs directory



 ____             __                                              __  __          __                               __
/\  _`\          /\ \                                            /\ \/\ \        /\ \__                           /\ \
\ \,\L\_\  __  __\ \ \____    ____  _____      __      ___     __\ \ `\\ \     __\ \ ,_\  __  __  __    ___   _ __\ \ \/'\
 \/_\__ \ /\ \/\ \\ \ '__`\  /',__\/\ '__`\  /'__`\   /'___\ /'__`\ \ , ` \  /'__`\ \ \/ /\ \/\ \/\ \  / __`\/\`'__\ \ , <
   /\ \L\ \ \ \_\ \\ \ \L\ \/\__, `\ \ \L\ \/\ \L\.\_/\ \__//\  __/\ \ \`\ \/\  __/\ \ \_\ \ \_/ \_/ \/\ \L\ \ \ \/ \ \ \\`\
   \ `\____\ \____/ \ \_,__/\/\____/\ \ ,__/\ \__/.\_\ \____\ \____\\ \_\ \_\ \____\\ \__\\ \___x___/'\ \____/\ \_\  \ \_\ \_\
    \/_____/\/___/   \/___/  \/___/  \ \ \/  \/__/\/_/\/____/\/____/ \/_/\/_/\/____/ \/__/ \/__//__/   \/___/  \/_/   \/_/\/_/
                                      \ \_\
                                       \/_/

version: 0.5.1

Configuration creation process has started...
Do you have an existing farmer/reward address? [y/n]: y
Enter your farmer/reward address: st...
Enter your node name to be identified on the network(defaults to `jimco`, press enter to use the default): jc_windows_simple_cli
Specify a path for storing plot files (press enter to use the default: `"C:\\Users\\jimco\\AppData\\Roaming\\subspace-cli\\plots"`): e:\\subspace-simple-cli\\plots
Specify a path for storing node files (press enter to use the default: `"C:\\Users\\jimco\\AppData\\Roaming\\subspace-cli\\node"`): e:\\subspace-simple-cli\\node
Specify a plot size (defaults to `2.0 GB`, press enter to use the default): 10G
Specify the chain to farm. Available options are: [Gemini3e, Dev, DevNet].
 Defaults to `Gemini3e`, press enter to use the default:
Configuration has been generated at C:\Users\jimco\AppData\Roaming\subspace-cli
Ready for lift off! Run the follow command to begin:
`"C:\\Users\\jimco\\Desktop\\Subspace Simple CLI\\subspace-cli-windows-x86_64-skylake-v0.5.1-alpha-2.exe" farm`
PS C:\Users\jimco\Desktop\Subspace Simple CLI> ."C:\\Users\\jimco\\Desktop\\Subspace Simple CLI\\subspace-cli-windows-x86_64-skylake-v0.5.1-alpha-2.exe" farm
Starting node ...
Node started successfully!
 ◡  [00:08:17] 34% [██████████████████████████████████████▉                                                                           ] (19085/55956) 7.93bps, syncing, ETA: 01:17:26
PS C:\Users\jimco\Desktop\Subspace Simple CLI> .\subspace-cli-windows-x86_64-skylake-v0.5.1-alpha-2.exe
 Please select an option below using arrow keys (or `j` and `k`):

   > init
    farm
    wipe
    info
    open logs directory



 ____             __                                              __  __          __                               __
/\  _`\          /\ \                                            /\ \/\ \        /\ \__                           /\ \
\ \,\L\_\  __  __\ \ \____    ____  _____      __      ___     __\ \ `\\ \     __\ \ ,_\  __  __  __    ___   _ __\ \ \/'\
 \/_\__ \ /\ \/\ \\ \ '__`\  /',__\/\ '__`\  /'__`\   /'___\ /'__`\ \ , ` \  /'__`\ \ \/ /\ \/\ \/\ \  / __`\/\`'__\ \ , <
   /\ \L\ \ \ \_\ \\ \ \L\ \/\__, `\ \ \L\ \/\ \L\.\_/\ \__//\  __/\ \ \`\ \/\  __/\ \ \_\ \ \_/ \_/ \/\ \L\ \ \ \/ \ \ \\`\
   \ `\____\ \____/ \ \_,__/\/\____/\ \ ,__/\ \__/.\_\ \____\ \____\\ \_\ \_\ \____\\ \__\\ \___x___/'\ \____/\ \_\  \ \_\ \_\
    \/_____/\/___/   \/___/  \/___/  \ \ \/  \/__/\/_/\/____/\/____/ \/_/\/_/\/____/ \/__/ \/__//__/   \/___/  \/_/   \/_/\/_/
                                      \ \_\
                                       \/_/

version: 0.5.1

Configuration creation process has started...
Do you have an existing farmer/reward address? [y/n]:

Version

0.5.1

platform

  • [ ] linux
  • [X] windows
  • [ ] macos

Expected behavior

The software should offer the menu and then await my input.

PS C:\Users\jimco\Desktop\Subspace Simple CLI> .\subspace-cli-windows-x86_64-skylake-v0.5.1-alpha-2.exe
 Please select an option below using arrow keys (or `j` and `k`):

   > init
    farm
    wipe
    info
    open logs directory

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

jim-counter avatar Jul 06 '23 13:07 jim-counter

Could be related with this issue: https://github.com/crossterm-rs/crossterm/issues/797

In Windows crossterm since 0.26 (0.26.1 is our version) emits Release kind key events.

Hypothesis:

When a user executes the command without any arguments (pressing enter), the program starts and eventually the user releases the enter button and this event is interpreted as the user intending to select an option.

clostao avatar Jan 03 '24 13:01 clostao