winapps-org / winapps-org/winapps
waCheckIdle in $HOME/.local/bin/winapps is running in the foreground when command is closed
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 16k
- Forks
- 508
- Avg merge
- 13h 35m
- Merged PRs (30d)
- 3
Description
I was pleased to see that auto pause functionality was added recently, and that it should work with Podman. YAY.
However, is it implemented correctly? When running a command like winapps manual cmd.exe and then closing the window, then the waCheckIdle keeps the command in the foreground.
I enabled "debugging" in the winapps script:
...
+ touch /var/home/reenberg/.local/share/winapps/FreeRDP_Process_2194884.cproc
+ podman unshare --rootless-netns flatpak run --command=xfreerdp com.freerdp.FreeRDP /cert:tofu /d: /u:<user> /p:<password> /scale:140 +auto-reconnect +clipboard +home-drive /audio-mode:1 -wallpaper +dynamic-resolution +span /app:program:cmd.exe /v:127.0.0.1
+ wait 2194884
+ rm /var/home/reenberg/.local/share/winapps/FreeRDP_Process_2194884.cproc
+ [[ on == \o\n ]]
+ waCheckIdle
+ local TIME_INTERVAL=10
+ local TIME_ELAPSED=0
+ local SUSPEND_WINDOWS=0
+ '[' podman '!=' manual ']'
+ '[' podman '!=' docker ']'
+ ls '/var/home/reenberg/.local/share/winapps/FreeRDP_Process_*.cproc'
+ SUSPEND_WINDOWS=1
+ (( TIME_ELAPSED < AUTOPAUSE_TIME ))
+ ls '/var/home/reenberg/.local/share/winapps/FreeRDP_Process_*.cproc'
+ sleep 10
+ TIME_ELAPSED=10
+ (( TIME_ELAPSED < AUTOPAUSE_TIME ))
+ ls '/var/home/reenberg/.local/share/winapps/FreeRDP_Process_*.cproc'
+ sleep 10
+ TIME_ELAPSED=20
+ (( TIME_ELAPSED < AUTOPAUSE_TIME ))
+ ls '/var/home/reenberg/.local/share/winapps/FreeRDP_Process_*.cproc'
+ sleep 10
.. and so it loops
^C++ waCleanUp
++ '[' 2194884 -gt 0 ']'
++ kill -9 2194884
++ '[' -f /var/home/reenberg/.local/share/winapps/FreeRDP_Process_2194884.cproc ']'
++ exit 1
Is this really the intended behaviour? Should it not run in the background somehow instead?
It is fairly invasive that the terminal is just "hanging" without any indication to the user, as to what is happening, after you close the RDP window.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with $HOME/.local/bin/winapps, the waCheckIdle function, and the foreground command sequence shown in the report. Reproduce winapps manual cmd.exe, close the RDP window, and trace whether the idle-check loop blocks the terminal; done means the command exits or returns control as intended without breaking auto-pause behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100