Skip to content
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

terminal search issues #121

Closed
rezso opened this issue Jun 27, 2014 · 16 comments

Comments

@rezso
Copy link

commented Jun 27, 2014

The mate_desktop_prepend_terminal_to_vector() tries to find a terminal.
This is a good thing, but:

  • the -x option in mate-terminal (and in gnome-terminal) is buggy,
  • the function doesn't looks for widely used terminals (f. ex. xfce4-terminal, eterm, roxterm),
  • xterm is exists in the list, but this is the "fallback" terminal, so if the xterm not exists, the function tries to run xterm :)
    My solution for these issues:
    https://gist.github.com/rezso/5e08ab28dfcb8e4b12d6
@dnk

This comment has been minimized.

Copy link
Member

commented Jul 1, 2014

it's better to use preferred terminal instead of increasing hard coded terminals

@stefano-k

This comment has been minimized.

Copy link
Member

commented Jul 1, 2014

@infirit

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2014

@rezso Assuming the preferred terminal app is set, where is this causing issues exactly?

@infirit

This comment has been minimized.

@rezso

This comment has been minimized.

Copy link
Author

commented Jul 1, 2014

@infirit: it's possible to set the preferred terminal via GUI? And what happens, if the preferred terminal is missing? F. ex. removed by mistake, or broken.
Adding more terminals to the list is a secure way to run applications via desktop file IMHO.

@infirit

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2014

@rezso

it's possible to set the preferred terminal via GUI?

Yes, with mate-default-applications-properties

And what happens, if the preferred terminal is missing? F. ex. removed by mistake, or broken.

Why not try it and see what happens.. If I remember removing the default will cause another to be set automatically. But then as fall-back MATE tries mate-terminal and as a fall-back to the fall-back it tries a few common ones.

Adding more terminals to the list is a secure way to run applications via desktop file IMHO.

You still have not told us where this is causing you actual problems? Because I doubt it is in this function and more likely in the places I linked to.

@rezso

This comment has been minimized.

Copy link
Author

commented Jul 1, 2014

Okay, I found anything... this is a glib issue, but where is used the prepend_terminal_to_vector() glib function (https://git.gnome.org/browse/glib/tree/gio/gdesktopappinfo.c#n2360) in mate?
So, if I remove all terminals except mate-terminal, and I try to run midnight commander from the mate menu, I get an error message:
Could not launch „Midnight Commander”
Failed to execute child process („xterm”)
The xterm really not exists, but the mate-terminal is installed, and mate-terminal is the default terminal in the preferred applications.

@infirit

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2014

It is not used anywhere in MATE afaik. I pointed to the two places where I think this goes wrong earlier, see #121 (comment)

edit: small correction

@rezso

This comment has been minimized.

Copy link
Author

commented Jul 1, 2014

Okay, but if I apply this patch to glib, the problem is solved. So I use a patched glib now.

@rezso

This comment has been minimized.

Copy link
Author

commented Jul 2, 2014

The „Failed to execute child process” comes from here:
https://git.gnome.org/browse/glib/tree/glib/gspawn.c#n1505
HTH

@rezso

This comment has been minimized.

Copy link
Author

commented Jul 6, 2014

I think, the mate_desktop_prepend_terminal_to_vector() never used:
mate_desktop_prepend_terminal_to_vector() called by ditem_execute()
ditem_execute called by mate_desktop_item_launch_on_screen_with_env(), which uses
gtk_show_uri, which uses g_app_info_launch_default_for_uri()

@infirit

This comment has been minimized.

Copy link
Contributor

commented Nov 18, 2014

I added a g_warning just before the call to gtk_show_uri and it is never used for the menu and panel launchers. Which is how it should be as gtk_show_uri is only used for urls.

@infirit

This comment has been minimized.

Copy link
Contributor

commented Nov 18, 2014

I tracked it down to panel_app_info_launch_uris in https://github.com/mate-desktop/mate-panel/blob/master/mate-panel/libpanel-util/panel-launch.c#L97

And it does not look like an easy fix unfortunately.

@monnerat

This comment has been minimized.

Copy link

commented Feb 17, 2015

IMHO, glib will never be patched for mate :-( The fix has to be done in mate and, as said before, is not easy.
However, here is a very dirty workaround: if gnome-terminal is not installed, as root do:

ln -s /usr/bin/mate-terminal /usr/bin/gnome-terminal

It will not respect the preferred terminal, but at least will schedule the mate-terminal.

@madjxatw

This comment has been minimized.

Copy link

commented Feb 17, 2015

There seems to be two issues

  • If change preferred terminal from mate-terminal to any other, "Run in Terminal" doesn't work properly in Caja. On my machine, need to manually change exec-arg from -x to -e. Any advice?
  • Make a "Application in Terminal" launcher on desktop, it always calls rxvt which should be the first alternative if finds instead of mate-terminal. After I make the soft link /usr/bin/gnome-terminal linking to /usr/bin/mate-terminal, it's fixed.
@monsta

This comment has been minimized.

Copy link
Member

commented Jul 23, 2015

Time to close it and open new issues in relevant projects. This is not related to mate-desktop library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.