Closed idkCpp closed 3 years ago
To clarify, it's not that some things don't start, rather they appear to re-use the same shell that albert was launched in. The issue appears differently based on how it's ran.
When albert is running directly in a terminal window, you can launch htop
(note not with > htop
- Terminal extension works as you'd expect) and see it battle with albert for the stdout. I presume the same happens when albert is started at login, except there's no terminal window so it appears as if nothing happened.
Reference it getting "pretty glitchy" in my original comment, it's not just the visual glitches. F10 doesn't always work to quit htop and it stays running even after albert is terminated, so the only way out is to close the terminal entirely.
The glitchiness is difficult to describe, so I recorded a short-ish screencap that compares the two fixes. #802 is first to show it working, followed by #852 where htop simply refuses to quit after a couple instances are launched:
I haven't tested the latest changes to #852 just yet, so I'll check that out and review the PR when I get a chance later.
@dshoreman has a weird problem when using @h-m-h 's fix for #789 His problem is that some terminal applications just won't start while others will. When using @bebehei 's fix it works, also when launching from terminal it works.
The only difference between @bebehei 's fix and @h-m-h 's fix is the point in time when
terminalCommand
will be read. It's always the globals that get raced :DWhen querying the
terminalCommand
in the constructor of TermAction the following log output can be observed:The Applications Extension indexes the files and creates two cached
TermAction
s per file withTerminal=true
. But theterminalCommand
variable becomes ready at a later point in time. The Terminal Extension does not have this problem because it can only create theTermAction
on user input, whence theterminalCommand
is already ready.So the prepending problem (#789) can be solved by the (in my opinion) less beatiful approach of @bebehei (#802) but when the (again my opinion) better approach of @h-m-h (#852) is used the creation of the
TermAction
s must be synced with the availability ofterminalCommand
Seperatly this caching of the
TermAction
in the Applications Extension causes a change of the terminal command not to propagate to these items. So theterminalCommand
should be prepended on every invocation. This affects both fix approaches.