Comments (14)
Hi Fincer,
You can find the Exists() method within Command.cs itself on line 235:
http://bazaar.launchpad.net/~ztefn/haguichi/1.0/view/head:/src/Command.cs#L235
As you can see it simply executes "command -v {program here}" in a bash shell. If this "command -v" doesn't find a path to the programs binary Haguichi assumes it doesn't exist.
The current Vala/GTK3 version is still using the same technique:
http://bazaar.launchpad.net/~ztefn/haguichi/1.3/view/head:/src/command.vala#L93
PS: You should update your Haguichi version! ;P
from haguichi.
Hey,
thanks for quick response @ztefn ! I'll check those lines soon.
P.S. I know. I'm just too stubborn to do that. :)
Fincer
from haguichi.
You know you can just shrink the window down and it'll look almost the same as the GTK2 version, right?
from haguichi.
I didn't know that. Thanks for info, though.
It's actually more that I prefer keeping my system without GTK3 packages. Qt5 is my choice, but since the program is not Qt-based, and I really like the idea of Haguichi, I use the old GTK2 version instead.
There is a Qt-based hamachi UI program known as Quamachi around, but it's just too ugly. Haguichi's interface is much better.
from haguichi.
Ah, I see... here I thought people rather kept their system without Mono packages... =)
Anyway. Please let me know if you find anything problematic with the command detection which could be relevant to the Vala code too.
from haguichi.
Yeah sure! Thanks again for responding!
from haguichi.
I manually tested the following commands (~line 235):
bash -c "command -v konsole"
which returns
/usr/bin/konsole
However, these ones return nothing (~meaning null or empty) on my system:
bash -c "command -v gnome-terminal"
bash -c "command -v nemo"_
which is the problem. Simply using uppercase -V
parameter for command
in line 238 fixes the problem.
Condition if ( output.Contains ( "command not found" ) )
in line 240 returns true because output with lowercase -v
doesn't contain "command not found" string. It simply returns empty or null which therefore passes the check and causes strange bugs here.
Edit: not sure if any help but my bash version is bash 4.4.012
from haguichi.
I'm not so sure about this. Haguichi itself makes bash return "command not found" by appending &>/dev/null || echo 'command not found'
to the command. This prints "command not found" if the "command -v" command returns any error code (because as you saw, it doesn't print any error output).
So these commands is what you should actually run on your system to get the same output as Haguichi:
command -v konsole &>/dev/null || echo 'command not found'
command -v gnome-terminal &>/dev/null || echo 'command not found'
And to make sure what Haguichi actually determines, please check the debug output:
haguichi -d | grep Determine
Because it could also be that Haguichi does determine the right commands, but the threads finish only after the CommandsEditor already has been initialized. I recently stripped out the separate detection threads in the Vala code for that same reason: c6e51bb
from haguichi.
Hmm okay. Actually, yeah...
Commands
command -v konsole &>/dev/null || echo 'command not found'
command -v gnome-terminal &>/dev/null || echo 'command not found'
work as expected.
This is the terminal output of haguichi -d | grep Determine
without any patches to Commands.cs:
[02/10/2017 19:22:31 - fincer: ~ ]$ haguichi -d | grep Determine
[19:23:25.4859760 ENVIRONMENT] [Command.DetermineSudoThread] [19:23:25.4859760 ENVIRONMENT] [Command.DetermineRemoteDesktopThread] Command for remote desktop: vinagre
[19:23:25.4859760 ENVIRONMENT] [Command.DetermineFileManagerThread] Command for file manager: nautilus
[19:23:25.4859760 ENVIRONMENT] [Command.DetermineTerminalThread] Command for terminal: gnome-terminal
I need to investigate this bit further, thanks for the hints!
from haguichi.
I found the solution. Adding p.WaitForExit ();
to line 313 (Command.cs) solved the issue for me.
from haguichi.
Might be interesting to also log the output that Haguichi receives, right before the if/else statement:
Debug.Log ( Debug.Domain.Environment, "Command", "Output for command " + command + ": " + output );
from haguichi.
Yup. I added Debug.Log
s here and there.
Exists
never returned a correct boolean value (false in my case) for gnome-terminal command. For nautilus and dolphin...it returned true sometimes, sometimes false.
ReturnOutput
(lines 297-338) never returned "command not found" for gnome-terminal. Instead, it returned a null/empty value for it.
All randomness and strange outputs stopped once I added p.WaitForExit ();. I didn't even need to delete private threads you mentioned before.
Sorry for having troubled you with this issue.
from haguichi.
No problem. I'm glad for you having apparently unraveled the C# shenanigans! :)
from haguichi.
Haha thanks! Learning & debugging takes time, though the solutions can be pretty simple after all. It was just too nasty problem to let it be unsolved, anyway.
from haguichi.
Related Issues (20)
- Treat versioned tags as immutable HOT 3
- is:issue is:open why i cant connect to haguichi? everytime i try, he says "System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is off ". HOT 13
- My PID 1 is not "systemd" HOT 5
- Haguichi won't let me configure Hamachi HOT 3
- Haguichi seems to corrupt Hamachi on Ubuntu 20.04 HOT 6
- libappindicator3-1 package does not exist in Debian testing HOT 5
- issues account and constant Dc HOT 3
- Authentication is needed to run systemctl as superuser HOT 1
- Package as Flatpak for elementary OS 6 HOT 5
- AppCenter colors are low-contrast HOT 2
- Consider using GLib.Notification or send desktop entry hint with Notify HOT 2
- Use Gtk.Application.inhibit instead of manually using login interface HOT 7
- "Authentication is needed to run '/usr/bin/systemctl' as the super user" HOT 5
- Haguichi asking for authentication HOT 1
- Cant configure HOT 2
- Not working, not installing HOT 4
- Misspelled function: `aquire`
- Getting a "Hamachi version 2.1.0.203 is obsolete" message on start. HOT 15
- Provide a label for alias name HOT 9
- Gets disconnected HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haguichi.