时间持续比较长了,在Fedora 41 xfce环境下,xfce4-terminal新建tab页不会使用和前序一样的working directory,而是会自动使用默认的路径。
以为是xfce .config的问题,毕竟已经持续刷新了很多年的版本,只好把.config删了重建环境,也没用。
为了发现根因, 把xfce4-terminal换成了terminator, 然后再切新标签,就碰巧发现问题了。
gi.repository.GLib.GError: g_convert_error: The hostname of the URI “file://suse.407/home/suse/Desktop” is invalid (4)<br>Traceback (most recent call last):<br> File "/usr/lib/python3.13/site-packages/terminatorlib/terminal.py", line 980, in on_keypress<br> getattr(self, "key_" + mapping)()<br> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^<br> File "/usr/lib/python3.13/site-packages/terminatorlib/terminal.py", line 2069, in key_new_tab<br> self.get_toplevel().tab_new(self)<br> ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^<br> File "/usr/lib/python3.13/site-packages/terminatorlib/window.py", line 269, in tab_new<br> cwd = widget.get_cwd()<br> File "/usr/lib/python3.13/site-packages/terminatorlib/terminal.py", line 260, in get_cwd<br> return(GLib.filename_from_uri(vte_cwd)[0])<br> ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^<br>gi.repository.GLib.GError: g_convert_error: The hostname of the URI “file://suse.407/home/suse/Desktop” is invalid (4)<br>
然后就找到问题了
g_filename_from_uri rejects valid host names according to RFC 1123
https://gitlab.gnome.org/GNOME/glib/-/issues/3523
所以问题就是在主机名, 我的这台电脑多年用的数字名称,也不用等修复问题了, 把这个主机名一改就好, 豁然开朗。
W/R, change hostname from ‘suse.407’ to ‘suse.s407’