Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor is hidden and echo is off after electron-forge start #2055

Closed
3 tasks done
sersorrel opened this issue Nov 24, 2020 · 8 comments
Closed
3 tasks done

Cursor is hidden and echo is off after electron-forge start #2055

sersorrel opened this issue Nov 24, 2020 · 8 comments
Labels
blocked/upstream Issues blocked by upstream bugs bug

Comments

@sersorrel
Copy link

Preflight Checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

  • Electron Forge Version: 6.0.0-beta.54
  • Electron Version: v11.0.3
  • Operating System: Ubuntu 18.04 amd64
  • Last Known Working Electron Forge version:

Expected Behavior

When I start and then quit the electron application (by closing the window), electron-forge should exit and I should get my terminal back.

Actual Behavior

If I quit the electron app, electron-forge terminates, but it turns off echo and hides the cursor. If I ctrl-c electron-forge instead of closing the window, this doesn't happen (I get the cursor back like normal).

To Reproduce

$ gh repo clone sersorrel/clicky
$ cd clicky
$ npm i
$ npm start
$ # then close the window that opens

Additional Information

Running with DEBUG=*,electron-forge mitigates the issue.

@sersorrel sersorrel added the bug label Nov 24, 2020
@malept
Copy link
Member

malept commented Nov 24, 2020

I can't reproduce this with Ubuntu 18.04 (amd64) and your repro steps on either gnome-terminal or wezterm. Which terminal are you using?

@malept
Copy link
Member

malept commented Nov 24, 2020

Also can you reproduce this with https://github.com/electron/electron-quick-start ?

@sersorrel
Copy link
Author

alacritty, though I can also reproduce in gnome-terminal.

on further investigation, turning off my fancy prompt helps, though it's still behaving weirdly – once the app exits, I can type and see the characters echo back, but pressing e.g. ctrl-c doesn't do anything until I've hit enter at least once.

electron-quick-start behaves fine.

@malept malept added the blocked/upstream Issues blocked by upstream bugs label Nov 24, 2020
@malept
Copy link
Member

malept commented Nov 24, 2020

Yeah this is definitely some weird interaction between your fancy prompt and a library used by Forge. I just tested with alacritty (and the default-ish starship prompt) and it still works fine for me.

Since running with DEBUG seems to work for you, I'm inclined to believe that this is a bug with ora rather than Electron Forge itself.

@malept malept closed this as completed Nov 24, 2020
@sersorrel
Copy link
Author

for my own benefit as much as anything else: I've now tested with starship (cool prompt, thanks!), and even with plain dash with no prompt at all, and it still misbehaves. running npm start </dev/null works, but obviously means you can't restart by typing rs.

out of interest @malept what node version were you testing with? (v14.15.1 here)

@malept
Copy link
Member

malept commented Nov 25, 2020

I'm running Node.js 10.23.0.

I just installed and used v14.15.1 via nodeenv and I still can't reproduce it.

@sersorrel
Copy link
Author

aha, I don't have the issue on node 10.23.0! I'll try and narrow that down tomorrow (for my own reference: broken on 12.16.1). thanks!

@beorn
Copy link

beorn commented Mar 28, 2021

I am still seeing this (and complete disabling of ctrl-c afterwards - stty isig is turned off) with electron-forge 6.0.0-beta.54. It is a known issue with Ora and synchronous code that needs to be worked around in one of these ways:

  • Use async calls instead.
  • Run the blocking code in a worker_thread.
  • Run the blocking code in a child_process.
  • Disable Ora's stty overrides by setting {discardStdin: false, hideCursor: false } as seen here.

I'm seeing this with zsh and some terminals (like Hyper.is but not Terminal.app), so my guess is that some terminals do some workarounds and fixes for such issues, however that doesn't mean not cleaning up properly isn't an issue.

I think this issue should be re-opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/upstream Issues blocked by upstream bugs bug
Projects
None yet
Development

No branches or pull requests

3 participants