Tmux hacking startingpoint?

36 views
Skip to first unread message

Tobias Damisch

unread,
Jun 9, 2021, 12:54:14 AM6/9/21
to tmux-...@googlegroups.com
Hi there!

I love using tmux!

So:

1.) I'd like to subscribe to this mailing list, how do i do that?

2.) I'd like to start modifying tmux behaviour by modifying the source code,
and if successful, maybe submit a patch.
I thought I had the right part of the code, but my modification doesn't
do anything (while compiling successfully). I tried outputting info
with log_debug(), and it seems this part of the code (window_pane_find_up() in
window.c) is not executed when doing a select-pane -U. Can someone maybe point
me to the right place to start?

Basically, I want to make switching panes with the arrow keys dependent on
the amount of shared border, and not primarily which pane was selected last,
a behaviour that I find slightly annoying, because who remembers which pane that was...


Cheers,
Tobias

Nicholas Marriott

unread,
Jun 9, 2021, 1:58:21 AM6/9/21
to Tobias Damisch, tmux-users
Look at cmd-select-pane.c, window_pane_find_up is definitely called when you do selectp -U. Are you sure you ran the right tmux binary with your logging?

But you should note that it is unlikely this behaviour will be changed again, see 540f0b3e45acae9b0c5fa12f7e9170c6c78d177f.


--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/trinity-9f50f1d3-dc88-4819-8381-25f48bf9c4f4-1623200384729%403c-app-gmx-bap64.

Tobias Damisch

unread,
Jun 9, 2021, 9:30:00 AM6/9/21
to tmux-...@googlegroups.com
Thanks for the tip, I did execute the right binary but still the server of my other running tmux was used.
Got it working now, implemented the desired behaviour in a quick-and-dirty fashion - and now I am not sure if I even like it.
Guess I have to use it for some time to see how I feel about it when I get used to it.

What about making this a config option, and defaulting it to current behaviour?

Cheers,
Tobias
 
 
 

Gesendet: Mittwoch, 09. Juni 2021 um 07:58 Uhr
Von: "Nicholas Marriott" <nicholas...@gmail.com>
An: "Tobias Damisch" <tobias_...@gmx.at>
Cc: "tmux-users" <tmux-...@googlegroups.com>
Betreff: Re: Tmux hacking startingpoint?

Nicholas Marriott

unread,
Jun 9, 2021, 9:44:28 AM6/9/21
to Tobias Damisch, tmux-users
Hi

I would prefer to avoid config options for trivial behaviour changes that realistically only one or two people are going to use.

You should be able to write a shell script to implement the behaviour you want and then bind it to the keys with run-shell. If that turns out to need any format variables that do not currently exist then we could add them.


--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.

Tobias Damisch

unread,
Jun 9, 2021, 11:05:07 AM6/9/21
to tmux-...@googlegroups.com
If I decide to keep my custom behaviour, I have the code now and can always compile my own custom tmux.
If no one else is interested, that's fine with me, I just wanted to offer my patch in the spirit of FOSS.

Keep up the good work!

Cheers,
Tobias
 

Gesendet: Mittwoch, 09. Juni 2021 um 15:44 Uhr
Von: "Nicholas Marriott" <nicholas...@gmail.com>
An: "Tobias Damisch" <tobias_...@gmx.at>
Cc: "tmux-users" <tmux-...@googlegroups.com>
Betreff: Re: Re: Tmux hacking startingpoint?

Hi
 
I would prefer to avoid config options for trivial behaviour changes that realistically only one or two people are going to use.
 
You should be able to write a shell script to implement the behaviour you want and then bind it to the keys with run-shell. If that turns out to need any format variables that do not currently exist then we could add them.
 
 

On Wed, 9 Jun 2021 at 14:30, Tobias Damisch <tobias_...@gmx.at[mailto:tobias_...@gmx.at]> wrote:Thanks for the tip, I did execute the right binary but still the server of my other running tmux was used.
Got it working now, implemented the desired behaviour in a quick-and-dirty fashion - and now I am not sure if I even like it.
Guess I have to use it for some time to see how I feel about it when I get used to it.

What about making this a config option, and defaulting it to current behaviour?

Cheers,
         Tobias
 
 
 

Gesendet: Mittwoch, 09. Juni 2021 um 07:58 Uhr
Von: "Nicholas Marriott" <nicholas...@gmail.com[mailto:nicholas...@gmail.com]>
An: "Tobias Damisch" <tobias_...@gmx.at[mailto:tobias_...@gmx.at]>
Cc: "tmux-users" <tmux-...@googlegroups.com[mailto:tmux-...@googlegroups.com]>
Betreff: Re: Tmux hacking startingpoint?

Look at cmd-select-pane.c, window_pane_find_up is definitely called when you do selectp -U. Are you sure you ran the right tmux binary with your logging?
 
But you should note that it is unlikely this behaviour will be changed again, see 540f0b3e45acae9b0c5fa12f7e9170c6c78d177f.

--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com[mailto:tmux-users%2Bunsu...@googlegroups.com].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/trinity-9a0ddd75-10fe-4c7e-b705-1167a86e5b69-1623245398542%403c-app-gmx-bs39[https://groups.google.com/d/msgid/tmux-users/trinity-9a0ddd75-10fe-4c7e-b705-1167a86e5b69-1623245398542%403c-app-gmx-bs39].
 
--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com[mailto:tmux-users+...@googlegroups.com].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/CAEdLfcH91PoMmQXzFFH7LCqV7my_%2B%3DCpM5nNBS51-XxRP-9nWA%40mail.gmail.com[https://groups.google.com/d/msgid/tmux-users/CAEdLfcH91PoMmQXzFFH7LCqV7my_%2B%3DCpM5nNBS51-XxRP-9nWA%40mail.gmail.com?utm_medium=email&utm_source=footer].

Christian Hopps

unread,
Jun 9, 2021, 1:54:35 PM6/9/21
to Tobias Damisch, tmux-...@googlegroups.com
Perhaps there’s an area we could collect interesting script additions for things like this?
> To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/trinity-daeb3540-64aa-41f0-a76c-cf99f7e0205b-1623251106161%403c-app-gmx-bs39.
>

Nicholas Marriott

unread,
Jun 10, 2021, 5:16:52 AM6/10/21
to Christian Hopps, Tobias Damisch, tmux-users
There is https://github.com/tmux/tmux/wiki/Recipes which has smaller stuff which I added, or you could create a repository on GitHub easily enough to gather scripts?



Reply all
Reply to author
Forward
0 new messages