-
Notifications
You must be signed in to change notification settings - Fork 7
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
Improve heuristic for detecting terminal output #91
Comments
Always glad to hear I'm helping someone :)
What version of Also what version of Hyprland are you using? I also use Hyprland and use a keybind similar to yours, but I currently do not have the same problem.
By all means, go ahead. |
Oh, that's interesting. I think it worked at some point for me, but I don't use the binding too much so I don't remember. when it happened. I'm currently running handlr-regex |
I am also running What terminal emulator and shell are you using? Does this happen with other terminal-based programs? Do you have Also, what is the exact Hyprland bind that you are using? |
Thanks for the help!
Ah, I guess we're both on nixos-unstable? Haha
Alacritty and fish.
Yep, I've tried setting the
Yep! Here's how it looks like:
Also,
Here you go:
As mentioned, appending a |
I can replicate the bug using alacritty. Do you have |
Hey Yep, I do (but I think it was autogenerated by handlr). It's set to
Which is the right setting for alacritty. I added some logging, and it seems that It's weird that you can reproduce it with alacritty but not other terminals, though. I wonder if that's two separate issues? Can you try running it with this patch? diff --git a/src/common/desktop_entry.rs b/src/common/desktop_entry.rs
index 6cf050a..644d472 100644
--- a/src/common/desktop_entry.rs
+++ b/src/common/desktop_entry.rs
@@ -129,6 +129,7 @@ impl DesktopEntry {
exec.extend_from_slice(&args);
}
+ std::fs::write("/tmp/handlr.log", format!("Requires terminal={}, Has terminal output={}", self.terminal, config.terminal_output)).unwrap();
// If the entry expects a terminal (emulator), but this process is not running in one, we
// launch a new one.
if self.terminal && !config.terminal_output { |
It seems that both hyprland and sway forward their stdin and stdout to programs launched in them through bindings. Launching Hyprland with Maybe this is out of scope for handlr to handle (heh)? Perhaps handlr could have a flag (maybe something like |
If
Strange. That is probably what is throwing off the terminal detection. Although I wonder why it is happening on your system and not mine.
I agree, it seems more like a Hyprland-related issue at this point.
Good idea. I'll make sure to implement it in the near future. Another workaround you might consider in the meantime would be launching the terminal manually like this:
|
Don't worry about that! Thanks a lot for taking some time to help me out :))
Hmmm, how you are you launching Hyprland? I'm personally using greetd+regreet
I'll see if I can get a quick patch going in the next couple of days Thanks a lot, and happy holidays! |
Hi there! Thanks for this lovely project, it's by far the tool that best handles my use cases, and I'm super thankful to you for picking up maintenance and adding so many nice features.
I'm not sure if there's something wrong in my setup, but it seems that the terminal output detection gives false positives and thus, in some situations, does not launch a new terminal for apps that have
Terminal=true
.For example: running
handlr launch text/plain
through hyprlandbind
s does not launch a terminal for neovim, but bindinghandlr launch text/plain | cat
does. The same happens if I run it throughwofi
srun
menu. Both are surely not attached to a terminal (so no visible neovim for me), and yet are detected as such by handlr.Is it alright if I look into improving this somehow? Just wanted make sure it's not something that only happens to me, haha.
Or maybe the issue is with Hyprland after all. I wonder if other people have the same issues in other WMs. I'll see if I can test it with sway later today.
Thanks!
The text was updated successfully, but these errors were encountered: