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

Auto-cd not working #12

Closed
piekay opened this issue Apr 25, 2018 · 17 comments
Closed

Auto-cd not working #12

piekay opened this issue Apr 25, 2018 · 17 comments
Labels
bug

Comments

@piekay
Copy link

@piekay piekay commented Apr 25, 2018

I've just installed the latest Version of nautilus-terminal and Auto-cd isn't working.
For example: when I am joining ~/Documents it isn't working.
I am using Arch Linux with latest updates of all programs.
Edit: nautilus-terminal isn't from the AUR. It is at the latest Github version!

@flozz

This comment has been minimized.

Copy link
Owner

@flozz flozz commented Apr 26, 2018

Hello,

can you start Nautilus Terminal in debug mode from a console:

nautilus -q  # quit nautilus
NAUTILUS_TERMINAL_DEBUG=true nautilus  # restart nautilus with debug enabled

then try to navigate. Do you have lines like this in the logs?

[Nautilus Terminal][ LOG] NautilusTerminal.change_directory: current directory NOT changed to /home/... (shell busy)
@piekay

This comment has been minimized.

Copy link
Author

@piekay piekay commented Apr 26, 2018

[Nautilus Terminal][ LOG] Crowbar inserted at /home/example
[Nautilus Terminal][ LOG] No NautilusTerminal instance found (new tab): creating a new NautilusTemrinal...
[Nautilus Terminal][ LOG] backup_nautilus_accels: backuping accels...
[Nautilus Terminal][ LOG] NautilusTerminal._spawn_shell: Shell spawned (/bin/bash), PID: 9052.
[Nautilus Terminal][ LOG] remove_nautilus_accels: removing accels...
[Nautilus Terminal][ LOG] restore_nautilus_accels: restoring accels...
[Nautilus Terminal][ LOG] Crowbar inserted at /home/example/Downloads
[Nautilus Terminal][ LOG] NautilusTerminal instance found: updating its path...
[Nautilus Terminal][ LOG] NautilusTerminal.change_directory: current directory changed to /home/example/Downloads
[Nautilus Terminal][ LOG] NautilusTerminal._inject_command: cd '/home/example/Downloads'
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nautilus_terminal/crowbar.py", line 25, in _on_parent_set
create_or_update_natilus_terminal(self)
File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 41, in create_or_update_natilus_terminal
vpanel._nt_instance.change_directory(crowbar.path)
File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 123, in change_directory
self._inject_command(" cd %s" % helpers.escape_path_for_shell(self._cwd))
File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 163, in _inject_command
self._ui_terminal.feed_child("%s\n" % command, len(command) + 1)
TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)

@piekay

This comment has been minimized.

Copy link
Author

@piekay piekay commented Apr 26, 2018

And nautilus -q
/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py:4: PyGIWarning: Vte was imported without specifying a version first. Use gi.require_version('Vte', '2.91') before import to ensure that the right version gets loaded.
from gi.repository import GLib, Gio, Gtk, Gdk, Vte

  • Starting Nautilus Terminal
@flozz flozz added the bug label Apr 26, 2018
@flozz

This comment has been minimized.

Copy link
Owner

@flozz flozz commented Apr 26, 2018

What is the result of the following command:

python <<< "from gi.repository import Vte; print('v%i.%i.%i' % (Vte.get_major_version(), Vte.get_minor_version(), Vte.get_micro_version()))"

For me the returned Vte version is v0.48.4

@piekay

This comment has been minimized.

Copy link
Author

@piekay piekay commented Apr 26, 2018

For me it is v0.52.1

@flozz flozz closed this in 67313b5 May 2, 2018
@flozz

This comment has been minimized.

Copy link
Owner

@flozz flozz commented May 2, 2018

Hello,

The problem seems to be an API inconsistency (a problem with GI and Python bindings of VteTerminal...). Anyway a made a workaround.

Please let me know if it solves your issue :)

@piekay

This comment has been minimized.

Copy link
Author

@piekay piekay commented May 2, 2018

The Error changed:
[Nautilus Terminal][ LOG] Crowbar inserted at /home/example
[Nautilus Terminal][ LOG] No NautilusTerminal instance found (new tab): creating a new NautilusTerminal...
[Nautilus Terminal][ LOG] backup_nautilus_accels: backuping accels...
[Nautilus Terminal][ LOG] NautilusTerminal._spawn_shell: Shell spawned (/bin/bash), PID: 13426.
[Nautilus Terminal][ LOG] remove_nautilus_accels: removing accels...
[Nautilus Terminal][ LOG] restore_nautilus_accels: restoring accels...
[Nautilus Terminal][ LOG] Crowbar inserted at /home/example/Downloads
[Nautilus Terminal][ LOG] NautilusTerminal instance found: updating its path...
[Nautilus Terminal][ LOG] NautilusTerminal.change_directory: current directory changed to /home/pascal/Downloads
[Nautilus Terminal][ LOG] NautilusTerminal._inject_command: cd '/home/example/Downloads'
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nautilus_terminal/crowbar.py", line 25, in _on_parent_set
create_or_update_natilus_terminal(self)
File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 51, in create_or_update_natilus_terminal
vpanel._nt_instance.change_directory(crowbar.path)
File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 133, in change_directory
self._inject_command(" cd %s" % helpers.escape_path_for_shell(self._cwd))
File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 173, in _inject_command
_vte_terminal_feed_child(self._ui_terminal.feed_child, "%s\n" % command)
File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 22, in _vte_terminal_feed_child
if len(vte_terminal.feed_child.get_arguments) == 2:
AttributeError: 'gi.FunctionInfo' object has no attribute 'feed_child'

@flozz flozz reopened this May 2, 2018
@flozz

This comment has been minimized.

Copy link
Owner

@flozz flozz commented May 2, 2018

Yes it seems I made a mistake, I will look at this :)

@flozz

This comment has been minimized.

Copy link
Owner

@flozz flozz commented May 2, 2018

Should be ok now :)

@piekay

This comment has been minimized.

Copy link
Author

@piekay piekay commented May 2, 2018

Next Error #ErrorParty

[Nautilus Terminal][ LOG] Crowbar inserted at /home/example
[Nautilus Terminal][ LOG] No NautilusTerminal instance found (new tab): creating a new NautilusTerminal...
[Nautilus Terminal][ LOG] backup_nautilus_accels: backuping accels...
[Nautilus Terminal][ LOG] NautilusTerminal._spawn_shell: Shell spawned (/bin/bash), PID: 1792.
[Nautilus Terminal][ LOG] remove_nautilus_accels: removing accels...
[Nautilus Terminal][ LOG] restore_nautilus_accels: restoring accels...
[Nautilus Terminal][ LOG] Crowbar inserted at /home/example/Downloads
[Nautilus Terminal][ LOG] NautilusTerminal instance found: updating its path...
[Nautilus Terminal][ LOG] NautilusTerminal.change_directory: current directory changed to /home/pascal/Downloads
[Nautilus Terminal][ LOG] NautilusTerminal._inject_command:  cd '/home/example/Downloads'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nautilus_terminal/crowbar.py", line 25, in _on_parent_set
    create_or_update_natilus_terminal(self)
  File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 51, in create_or_update_natilus_terminal
    vpanel._nt_instance.change_directory(crowbar.path)
  File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 133, in change_directory
    self._inject_command(" cd %s" % helpers.escape_path_for_shell(self._cwd))
  File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 173, in _inject_command
    _vte_terminal_feed_child(self._ui_terminal, "%s\n" % command)
  File "/usr/lib/python2.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 23, in _vte_terminal_feed_child
    return vte_terminal.feed_child(text, len(text) + 1)
TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)

German Errors vs french developer :p.
I will try to fix it too.

@flozz

This comment has been minimized.

Copy link
Owner

@flozz flozz commented May 2, 2018

What is the result of the following command?

python <<< "from gi.repository import Vte; t = Vte.Terminal; print(t.feed_child.get_arguments())"
@piekay

This comment has been minimized.

Copy link
Author

@piekay piekay commented May 2, 2018

<stdin>:1: PyGIWarning: Vte was imported without specifying a version first. Use gi.require_version('Vte', '2.91') before import to ensure that the right version gets loaded. (gi.ArgInfo(text), gi.ArgInfo(length))

@flozz

This comment has been minimized.

Copy link
Owner

@flozz flozz commented May 2, 2018

Ok... it seems there is a deeper problem. I will try to find what is going on :/

@flozz

This comment has been minimized.

Copy link
Owner

@flozz flozz commented May 4, 2018

I installed an Archlinux and a Fedora 28 VM, and I can reproduce this issue on both. I have no issue on Ubuntu 18.04.

It seems that the problem is located somewhere in Vte, or more likely, in pygobject or gobject-introspection.

Here is a minimal example that allows to reproduce the issue:

#!/usr/bin/env python

import gi

gi.require_version("Gtk", "3.0")  # noqa
gi.require_version("Vte", "2.91")  # noqa

from gi.repository import GLib, Gtk, Vte

CMD = "echo hello\n"

# Print some infos

print("GI VERSION:   %i.%i.%i" % gi.version_info)
print("GLIB VERSION: %i.%i.%i" % GLib.glib_version)
print("VTE VERSION:  %i.%i.%i" % (
    Vte.get_major_version(),
    Vte.get_minor_version(),
    Vte.get_micro_version()))
print("ARGUMENTS:    Vte.Terminal.feed_child%s" % str(
    Vte.Terminal.feed_child.get_arguments()))

# Test case

win = Gtk.Window(title="Vte Terminal feed_child test")
win.connect("destroy", Gtk.main_quit)
term = Vte.Terminal()
win.add(term)
win.show_all()

term.spawn_sync(
    Vte.PtyFlags.DEFAULT, None, ["/bin/sh"],
    None, GLib.SpawnFlags.SEARCH_PATH, None, None)

term.feed_child(CMD, len(CMD))

Gtk.main()

Output on Ubuntu 18.04:

GI VERSION:   3.26.1
GLIB VERSION: 2.56.1
VTE VERSION:  0.52.1
ARGUMENTS:    Vte.Terminal.feed_child(gi.ArgInfo(text), gi.ArgInfo(length))

Output on ArchLinux and Fedora 28:

GI VERSION:   3.28.2
GLIB VERSION: 2.56.1
VTE VERSION:  0.52.1
ARGUMENTS:    Vte.Terminal.feed_child(gi.ArgInfo(text), gi.ArgInfo(length))
Traceback (most recent call last):
File "vte_terminal_feed_child.py", line 35, in <module>
    term.feed_child(CMD, len(CMD))
TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)

I will report the issue on the GNOME bug tracker to find a solution :)

@AetherEternity

This comment has been minimized.

Copy link

@AetherEternity AetherEternity commented May 6, 2018

Same thing on Kali linux (GNOME v3.28) & lastest github plugin version

[Nautilus Terminal][ LOG] NautilusTerminal instance found: updating its path...
[Nautilus Terminal][ LOG] NautilusTerminal.change_directory: current directory changed to /root/R-Studio
[Nautilus Terminal][ LOG] NautilusTerminal._inject_command:  cd '/root/R-Studio'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nautilus_terminal/crowbar.py", line 25, in _on_parent_set
    create_or_update_natilus_terminal(self)
  File "/usr/local/lib/python2.7/dist-packages/nautilus_terminal/nautilus_terminal.py", line 51, in create_or_update_natilus_terminal
    vpanel._nt_instance.change_directory(crowbar.path)
  File "/usr/local/lib/python2.7/dist-packages/nautilus_terminal/nautilus_terminal.py", line 133, in change_directory
    self._inject_command(" cd %s" % helpers.escape_path_for_shell(self._cwd))
  File "/usr/local/lib/python2.7/dist-packages/nautilus_terminal/nautilus_terminal.py", line 173, in _inject_command
    _vte_terminal_feed_child(self._ui_terminal, "%s\n" % command)
  File "/usr/local/lib/python2.7/dist-packages/nautilus_terminal/nautilus_terminal.py", line 23, in _vte_terminal_feed_child
    return vte_terminal.feed_child(text, len(text) + 1)
TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)

@flozz

This comment has been minimized.

Copy link
Owner

@flozz flozz commented Aug 13, 2018

Hello,

It should work now, I do not know why I was not able to solve this sooner. Anyway it is published in v3.2.2.

Please re-open the issue if the problem persist :)

@flozz flozz closed this Aug 13, 2018
@piekay

This comment has been minimized.

Copy link
Author

@piekay piekay commented Sep 4, 2018

New Error:
File "/usr/lib/python3.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 24, in _vte_terminal_feed_child
return vte_terminal.feed_child(text, len(text) + 1)
TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/nautilus_terminal/crowbar.py", line 25, in _on_parent_set
create_or_update_natilus_terminal(self)
File "/usr/lib/python3.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 53, in create_or_update_natilus_terminal
vpanel._nt_instance.change_directory(crowbar.path)
File "/usr/lib/python3.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 135, in change_directory
self._inject_command(" cd %s" % helpers.escape_path_for_shell(self._cwd))
File "/usr/lib/python3.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 175, in _inject_command
_vte_terminal_feed_child(self._ui_terminal, "%s\n" % command)
File "/usr/lib/python3.7/site-packages/nautilus_terminal/nautilus_terminal.py", line 27, in _vte_terminal_feed_child
return vte_terminal.feed_child(text)
TypeError: Must be number, not str

I cannot reopen this thread because you closed it...

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