Re: [hackers] [tabbed][PATCH] Use PWD xprop to set workdir for spawned clients

From: Nikita Zlobin <>
Date: Fri, 5 Jun 2020 21:25:03 +0500

In Thu, 4 Jun 2020 16:21:40 -0400
Daniel Moch <> wrote:

> On Thu, Jun 04, 2020 at 11:26:15AM +0500, Nikita Zlobin wrote:
> > Somewhat disconvenient after true multitab terminals, that new term
> > tabs don't inherit workdir from previous active. Here is some
> > attempt to make such a bond.
> My memory is that terminals in this case inherit their working
> directory from the parent shell, and not from the previous active
> tab. I confirmed this by installing and testing with xfce4-terminal.
> I'm not in favor of this change.

My appologies for toooo long text, I'm not good at detecting secondary
details when everything has meaning. I expected some more detailed
feedback about what could be improved, yet needed to try some things
before to write.

I think I found alternative way to achieve PWD inheritance, but it's
rxvt/urxvt specific. Thanks to it setting WM_COMMAND property, which
could be parsed for parent tabbed window, which could be set for new
clients. And easy configuration for new mouse/keyboard bindings (which
could open not only tab, but even startnew tabbed window). However, it
would require to disable tabbed new-tab action, since it's all to be
done from rxvt itself. How will other terms do like xterm/st - no idea,
since I can't find easy mean to get parent for certain window without
writing own dedicated one-function tool on top of XQueryTree().

But it looks like very existance of such path inheritance functionality
is not in favor. Just about why it's useful to me. When I start/resume
work at some software project, I usually need multiple windows. In xfce
term my tabs were called like 'edit', 'run', 'man', 'build', 'git' - at
least. All usually in one dir. Ideally I could just cd with one tab,
than multiply with shortcut. But with independent windows I have to
additionally mouse-paste+Enter workdir from first tab to all new.

My expectation from software like tabbed, surf etc are that it should
be as effective as it's flawless. I never had such flawless multitab
term as tabbed+urxvtc (urxvtd in desktop session start). If course not
without those patches I made, to stop tabbed ruining entire urxvt
daemon. So, there is it :).

Yet I would like to get advices about possibly better implementations.
Explaining my approach - I assumed, that getting PWD on each XEvent,
when client term uploads it to xprop, would be a bit pointless, since
it's used only on tab spawn, yet it could be opportunity from
theoretically possible XEvent spam (I'm not sure though, what should
run in shell for such to happen, gg). So, my approach was to get it
just when needed. Moreover, if PWD is not ever set by client shell
(configured hook), then it will not present at all. Unless documented -
I'm sure, potential user (if its user can be called so) will only
discover it by luck, probably digging to tabbed code for some reason.

I guessed, PWD in xprop could have other wanted uses, so that its
presence in xprop would not mean user wants it to be inherited. But I
just can't get any other idea. Of course, as said, clients could manage
that by themselves. If they have support arbitrary user bindings. But
then tabbar's own function for that should be disabled. Sounds not very
good - reminding what happens in gtk with csd now :/ .
Received on Fri Jun 05 2020 - 18:25:03 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 05 2020 - 18:36:31 CEST