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

Tilix VTE fix is not working #1513

Closed
marceloslacerda opened this issue Sep 5, 2018 · 31 comments
Closed

Tilix VTE fix is not working #1513

marceloslacerda opened this issue Sep 5, 2018 · 31 comments
Labels

Comments

@marceloslacerda
Copy link

Using either the first option or marking the "run command as login shell" checkbox doesn't change the behavior of Tilix, when I change the current directory and then open a new tab starts it in the home directory.

Here's a video showing the behavior: https://www.dropbox.com/s/v1adgl97tza82pz/Screencast%20from%2005-09-18%2012%3A41%3A41.webm?dl=0

@gnunn1
Copy link
Owner

gnunn1 commented Sep 5, 2018

Did you start a new terminal after enabling the login shell? If you open tilix, change that setting and then try to use the terminal that is already open to test it this won't work because that terminal was started as a non-login shell.

@marceloslacerda
Copy link
Author

marceloslacerda commented Sep 6, 2018 via email

@gnunn1
Copy link
Owner

gnunn1 commented Sep 12, 2018

Do you have the same problem with gnome-terminal, i.e. if you open gnome-terminal and navigate to a new directory, open a new tab is the directory in the new tab the home directory or the same directory as the previous tab. If it's the home directory you have the same problem and you can try setting the run command as login shell to see if it works there. Just looking to compare behaviors.

The other option, and the preferred one, is to simply source vte.sh as per the instructions.

@marceloslacerda
Copy link
Author

marceloslacerda commented Sep 13, 2018 via email

@gnunn1
Copy link
Owner

gnunn1 commented Sep 15, 2018

If you are sourcing vte, if you run the following in bash what do you see:

echo $PROMPT_COMMAND

You should see the command __vte_prompt_command as part of the output if it is being sourced correctly.

@marceloslacerda
Copy link
Author

marceloslacerda commented Sep 18, 2018 via email

@marceloslacerda
Copy link
Author

By the way I'm also using tilix on my home pc and there the same configuration works. It's nearly the same shell configuration synchronized via dropbox.

In case you are wondering I have no idea how's that possible either.

@gnunn1
Copy link
Owner

gnunn1 commented Sep 18, 2018

Unfortunately I'm out of ideas, I don't know what the issue is, sorry.

Is your home and work environment identical, i.e. using the same desktop environment and configured roughly similarly?

@marceloslacerda
Copy link
Author

Yeah they are both debian, same version, same user(name), all packages updated, bash is the default shell. The only difference is this line of code in .bashrc

try_to_source $HOME/.bashrc.host.hostname

Which sets proxy variables and a few aliases.

I've also tried commenting that line before opening tilix.

Can you point me to the code that tests whether tilix is configured correctly so I can test the state of the shell manually?

@gnunn1
Copy link
Owner

gnunn1 commented Sep 18, 2018

The code is at the link below but it's not something you can test easily since it relies on some timing behavior in VTE.

You can check if the warning is being generated falsely by opening a terminal, switching to a new directory and then splitting that terminal. If the new split terminal opens with the directory from the previous terminal then it is working, if it opens in your home directory then it is not working.

If it is working and the VTE warning is in error you can just check the box to not show it again.

@gnunn1
Copy link
Owner

gnunn1 commented Sep 18, 2018

@marceloslacerda
Copy link
Author

marceloslacerda commented Sep 18, 2018 via email

@sebp
Copy link

sebp commented Nov 1, 2018

I have a similar issue using tilix 1.8.3 on Fedora 29. The documentation states that the problem should be absent on Fedora. Yet, I'm getting the warning dialog when opening tilix. I removed modifications from .bashrc, expect sourcing /etc/bashrc. PROMPT_COMMAND is set to __vte_prompt_command, and adding source /etc/profile.d/vte.sh does not change the behaviour. gnome-terminal works without any issues, when opening a new tab, the current working directory is preserved. Please let me know if you need more information.

@marceloslacerda
Copy link
Author

marceloslacerda commented Dec 4, 2018 via email

@Zauxst
Copy link

Zauxst commented Jan 18, 2019

I'm on Ubuntu 18.04 with KDE installed and I have the same issue as described by the gentlemen above.

$ uname -a
Linux ----- 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ echo $PROMPT_COMMAND
__vte_prompt_command

$ tilix --version
Versions
	Tilix version: 1.7.7
	VTE version: 0.52
	GTK Version: 3.22.30

Tilix Special Features
	Notifications enabled=0
	Triggers enabled=0
	Badges enabled=0

I've tried both methods to make Tilix work and none of them worked.

edit:
I guess my issue is related to #1451, which it seems that KDE is not officially supported by the maintainer :(
edit2:
After enabling a setting in the general tab to preserve the folder directory location, and opening a new tilix window by typing in tilix, I do get the correct directory but using the interface to open left or down a terminal does not preserve folder path.
I've also disabled that startup error.

@framerate
Copy link

Login shell isn't working for me either (solus) and solus doesn't have /etc/profile.d

If anyone has a suggestion, let me know.

@gaviriacc26
Copy link

gaviriacc26 commented May 24, 2020

Login shell isn't working for me either (solus) and solus doesn't have /etc/profile.d

If anyone has a suggestion, let me know.

I solved this on Solus by putting source /usr/share/defaults/etc/profile.d/vte.sh in my .zshrc file.
It works like a charm for me. If you use bash, putting it in your .bashrc should also do the trick.

Hope it helps!

@pjaleeuwen
Copy link

I've been having this issue in Fedora 30/31/32. I apply the fix as suggested by the pop-up, it sources vte.sh properly, but it's not fixing anything. The login shell option doesn't do the trick either.

Any updates on this?

@marceloslacerda
Copy link
Author

marceloslacerda commented Jul 22, 2020 via email

@513G3
Copy link

513G3 commented Nov 22, 2020

I spent four days chasing this; no issue on an 18.04 at home... had the issue on 18.04 at work. My root cause was that the work computer’s hostname was set to all digits by the IT department. And this broke _vte_urlencode(). I locally changed my hostname in /etc/hosts and /etc/hostname and rebooted. Problem solved.

;)

I see newer versions of libvte relocated and refactored that function; I am unsure how the new call handles all digits.

@marceloslacerda
Copy link
Author

marceloslacerda commented Nov 22, 2020 via email

@jorrete
Copy link

jorrete commented Dec 7, 2020

Can confirm that on Fedora 33 this problems keeps happening and the solution of removing dots from hostname fixes it

@marceloslacerda
Copy link
Author

Yep, that was the problem. Thanks 513G3!

@dteleguin
Copy link

Same here, Mageia 8, hostname was set to localhost.localdomain. Neither sourcing vte.sh nor enabling login shell helped. Fixed by setting hostname to localhost.

@albfan
Copy link

albfan commented Nov 3, 2021

This looks to be still a thing in 2021:

Here output of PROMPT_COMMAND showing special chars with cat -A -. This is working on gnome-terminal and not working on tilix:

[alberto@localhost ~]$ echo $($PROMPT_COMMAND)| cat -A -
^[]777;notify;Command completed;echo $($PROMPT_COMMAND)| cat -A -^[\^[]777;precmd^[\^[]0;alberto@fedora:~^[\^[]7;file://fedora/home/alberto^[\$
[alberto@localhost ~]$ cd Descargas/
[alberto@localhost Descargas]$ echo $($PROMPT_COMMAND)| cat -A -
^[]777;notify;Command completed;echo $($PROMPT_COMMAND)| cat -A -^[\^[]777;precmd^[\^[]0;alberto@fedora:~/Descargas^[\^[]7;file://fedora/home/alberto/Descargas^[\$

Any ideas?

@albfan
Copy link

albfan commented Nov 4, 2021

check #1954

TL;DR:

HOSTNAME="/usr/bin/hostname 2>/dev/null"

looks like HOSTNAME changed from:

$ /usr/bin/hostname 2>/dev/null
localhost

to:

$ /usr/bin/hostnamectl --transient 2>/dev/null
fedora

and that puzzles tilix

@albfan
Copy link

albfan commented Nov 5, 2021

Probably problem is systemd network: https://www.freedesktop.org/software/systemd/man/systemd.network.html

UseHostname=
When true (the default), the hostname received from the DHCP server will be set as the transient hostname of the system.

that's why none of this work to change transient: https://www.freedesktop.org/software/systemd/man/systemd.network.html

Here details:

https://www.linode.com/community/questions/9524/solved-cannot-set-transient-hostname-on-arch-linux-linode

Honestly I prefer to change HOSTNAME than touch network config. See gnome terminal works with any hostname value, so probably tilix should use same way to get hostname as gnome-terminal

@albfan
Copy link

albfan commented Nov 5, 2021

Final solution thanks to @ckulacoglu

https://sleeplessbeastie.eu/2020/06/22/how-to-change-system-hostname/
Transient hostname can be used only in a specific situation where persistent hostname is set to localhost, localhost.localdomain or ends with these names (like debian.localhost.localdomain). See additional notes at the end.

So as long your hostname is set to localhost, your transient hostname might be different from your hostname (set by dhcp etc), causing the issues. Giving your system a personal hostname does not affect how "localhost" resolution works (which points to 127.0.0.1) unless you manually mess up with /etc/hosts

hostnamectl set-hostname thinkpad

fix this for me without doing anything on ~/.bashrc

@iacobucci
Copy link

check #1954

TL;DR:

HOSTNAME="/usr/bin/hostname 2>/dev/null"

looks like HOSTNAME changed from:

$ /usr/bin/hostname 2>/dev/null
localhost

to:

$ /usr/bin/hostnamectl --transient 2>/dev/null
fedora

and that puzzles tilix

Im sorry if this is not the right place to post this, but do you know the equivalent of ${username} variable? It seems that USERNAME isn't it.

@albfan
Copy link

albfan commented Dec 3, 2021

@pattex16 yo Bernd ti define a nam e por hora y hay os nos localista, so Tour alarmante os nos transient

hostnamectl set-hostname laptop

Or similar

@coresh
Copy link

coresh commented Nov 15, 2022

uname -a

Linux n-000001 6.0.7-100.fc35.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 3 21:31:24 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Solved by executed:

zsh:

echo 'HOSTNAME="$(/usr/bin/hostname 2>/dev/null)"' >> ~/.zshrc

bash:

echo 'HOSTNAME="$(/usr/bin/hostname 2>/dev/null)"' >> ~/.bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests