8000 `readKeyOrNull` throws exception on timeout rather than returning null · Issue #256 · ajalt/mordant · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

readKeyOrNull throws exception on timeout rather than returning null #256

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

Closed
JakeWharton opened this issue Feb 14, 2025 · 0 comments · Fixed by #258
Closed

readKeyOrNull throws exception on timeout rather than returning null #256

JakeWharton opened this issue Feb 14, 2025 · 0 comments · Fixed by #258

Comments

@JakeWharton
Copy link
Contributor

This might be my fault? I believe I was changing these "or null" codepaths to avoid using exceptions in the timeout case prior to 3.0. Maybe I didn't do a fully comprehensive job?

This is Windows, as you can see from the trace. Works fine on macOS.

Exception in thread "main" java.lang.RuntimeException: Timeout reading from console input
        at com.github.ajalt.mordant.terminal.terminalinterface.jna.TerminalInterfaceJnaWindows.readRawEvent(TerminalInterface.jna.windows.kt:278)
        at com.github.ajalt.mordant.terminal.terminalinterface.TerminalInterfaceWindows.readInputEvent(TerminalInterface.windows.kt:85)
        at com.github.ajalt.mordant.input.RawModeScope.readKeyOrNull-LRDsOJo(RawMode.kt:118)
        at com.jakewharton.mosaic.MosaicKt$readRawModeKeys$1.invokeSuspend(mosaic.kt:157)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0