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

WebSSH losing focus on MacOS, keyboard isn't responding anymore. #1025

Open
Tracked by #812
frepke opened this issue Dec 28, 2023 · 22 comments
Open
Tracked by #812

WebSSH losing focus on MacOS, keyboard isn't responding anymore. #1025

frepke opened this issue Dec 28, 2023 · 22 comments
Assignees
Labels
🐛 bug Something isn't working
Milestone

Comments

@frepke
Copy link

frepke commented Dec 28, 2023

Bug description

WebSSH losing focus on MacOS, keyboard isn't responding anymore when re-enter the app. Sometimes a paste-command (command+v) helps, but when pasting a command with an enter at the end....

Screenshots

If applicable, add screenshots to help explain your problem

Steps to reproduce

  1. open WebSSH
  2. Leave WebSSH and use another app
  3. Re-enter WebSSH
  4. Error is thrown (most of the time)
@isontheline
Copy link
Owner

Seems a duplicate of #812

Lot of users are encountering this problem 😓

A workaround is to click down on the terminal in order to gain focus again

@isontheline isontheline self-assigned this Dec 28, 2023
@isontheline isontheline added the 🐛 bug Something isn't working label Dec 28, 2023
@isontheline isontheline added this to the 24 - Dragon milestone Dec 28, 2023
@frepke
Copy link
Author

frepke commented Dec 31, 2023

I've noticed that the problem always occurs when the app runs in fullscreen mode. However, when the app runs in a window, the problem either doesn't occur or is significantly less frequent.

@isontheline
Copy link
Owner

Thank you so much @frepke for this information.
I will so try to reproduce and fix this bug when WebSSH is in fullscreen mode.

Many thanks again!

@isontheline
Copy link
Owner

  1. currently I constatnly experience a weird bug with my Pi 5 - WebSSH on a Mac constantly stops accepting text input from keyboard, though reacts to Ctrl C combination. I also managed to find out that it mostly happens when WebSSH is in full screen mode and pressing Cmd Ctrl F to exit full screen on a Mac brings text input back to life. And it mostly happens whenever I switch from WebSSH window to some other app and then get back to WebSSH.

From in_sympathy on the App Store

@MKC-MKC
Copy link

MKC-MKC commented Feb 18, 2024

I've noticed that the problem always occurs when the app runs in fullscreen mode. However, when the app runs in a window, the problem either doesn't occur or is significantly less frequent.

No, not always. But the problem occurs frequently, even if the application is not in full screen, and I switch between desktops through Mission Control...

@MKC-MKC
Copy link

MKC-MKC commented Feb 18, 2024

At the same time, I noticed that the arrow keys on the keyboard work. I thought it might be related to switching the language layout, but this problem occurs even without changing the language.

@isontheline
Copy link
Owner

Thanks @MKC-MKC

I will work on it in a couple of days

@isontheline
Copy link
Owner

I'm trying to reproduce the trouble but it doesn't occur in fullscreen mode on my MBA / Sonoma

Are you using multiple ssh terminals on the sidebar?
Does a clic on your session on the sidebar resolves the focus issue?

@frepke
Copy link
Author

frepke commented Mar 16, 2024

Hi Isontheline,

No, there's only one terminal open on the sidebar.
Sometimes the focus issue isn't there with some attempts, a bit later it's suddenly there.
Clicking on the sidebars session will resolve the problem most of the time, sometimes clicking in the terminal venster is the solution. In the passed I had to use command+V

@isontheline
Copy link
Owner

Hi @frepke 👋

Many thanks for your feedback!

I'm continuing to try to reproduce.

Hope it will be fixed asap.

@nothingto
Copy link

nothingto commented Apr 3, 2024

Can confirm this is happening to me - super annoying.

Whenever the app loses focus, and the cursor goes to another window, the cursor on the terminal stops blinking. Then it takes no keyboard input. It takes about 2-3 seconds to come back up, sometimes never. No other terminal is on. Happens on a consistent manner.

I’m on iPadOS. Magic Keyboard and Mouse. This occurs especially more when i’m split windowing also and the mouse loses focus a lot. This is not happening on other terminal apps (termius, etc).

I know you’re finding this difficult to debug, but it’s the only thing that really is keeping this app from standing out from the rest. I supported and bought out the app, so hopefully this can get resolved, since this is almost unusable in this state.

@isontheline
Copy link
Owner

Thanks for reporting to me @nothingto
I understand that it’s very annoying.

What happens if you tap on the « keyboard » icon on the navigation bar?
Does the focus remain?

@nothingto
Copy link

nothingto commented Apr 3, 2024

Thanks for reporting to me @nothingto I understand that it’s very annoying.

What happens if you tap on the « keyboard » icon on the navigation bar? Does the focus remain?

@isontheline
Yes! That’s it! Although, this needs to be patched up because it does not make intuitive sense for this to not be the default state when the mouse cursor or a finger tap to the terminal event happens.

Although there is another bug. When the keyboard icon is pressed, it also HOGS/controls all ownership of input even across other windows that are not the terminal (safari, etc) especially if they’re split windows.

So the behavior when the keyboard icon gets clicked is it steals input from other windows, so you’re not able to type, and it also takes back control of focus from other apps. In the end, still unuseable but from a different perspective/angle where the tables get flipped.

Possible solution:

1.) When WebSSH sees that it is focused, automatically turn keyboard on (then it can be toggleable to be off), when it sees that the focus is lost, turn off the keyboard focus state regardless of whether the existing state was on/off. It then reinses and repeats the state and turns on/off the keyboard by default based on focus.

I will note though that in fullscreen single app mode, this works as normal when keyboard is pressed. However, this is often never the case since you’re either looking at documentation within split screen mode/floating mode/etc and at multiple windows (stage manager, etc). So keyboard toggling and then taking/stealing ownership of input focus is still not intended behavior (or i hope not 😉 )

Given that this issue is macOS only, this is however also the case with iPadOS/iOS as well since i’m using this on iPadOS. This issue will need to be refocused for all platforms.

@isontheline
Copy link
Owner

Thanks for your strong feedback @nothingto 🙏

This issue will need to be refocused for all platforms.

Definitively yes.
I will work on it as soon as I can, no ETA yet.
High in my todo list, I promise

@isontheline isontheline modified the milestones: 25 - Sunflower, 26 - Train Apr 7, 2024
@isontheline
Copy link
Owner

From Elrick :

This bug is not specific to the beta as the current stable has the same issue. On Mac OS when you swipe away from WebSSH to a full screen app and then back to WebSSH, you can't type in the terminal right away.

@frepke
Copy link
Author

frepke commented Jul 11, 2024

Any update about this very annoying issue?

@isontheline
Copy link
Owner

No update.
=> little to no reproducible when debugger is attached from Xcode to WebSSH
But reproducible "easily" when launched as standalone.

Will try again to work on it at end of holiday

@isontheline isontheline modified the milestones: 26 - Train, 27 - Stars Jul 12, 2024
@isontheline
Copy link
Owner

@frepke When the issue comes up, does WebSSH have only one tab (or multiple or multiple windows)?

@frepke
Copy link
Author

frepke commented Jul 15, 2024

@frepke When the issue comes up, does WebSSH have only one tab (or multiple or multiple windows)?

Only one tab is used.

@isontheline
Copy link
Owner

Thank you @frepke

Have you some time to test WebSSH 27.2.1378 ?
https://testflight.apple.com/join/QSrBK59z

@frepke
Copy link
Author

frepke commented Jul 16, 2024

Yes, will do. I'll report back as soon I've my results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants