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

Restoring pane title #342

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

c3r34lk1ll3r
Copy link

Hi,

I made a little improvement adding the restoring of pane title. Simply, I added #{pane_title} to pane_format and tmux select-pane -T <title> in restoring.

This PR will fix also issue #330

@zachthedev
Copy link

I would love to see this part of the next release!

@neerajbadlani
Copy link

Tried this patch , named titles are saved and restored , howevers panes with empty titles are restored with current directory path . Can you please fix that too ?

@ioogithub
Copy link

I too would really appreciate if this PR can be introduced. I took several hours to make 'panestankingly' create a beautiful system dashboard with each pane having a descriptive title. When I used tmux-resurrect and restored my session, all that work was lost.

This was quite unexpected as I thought tmux-resurrect saves all the little details from your tmux environment so it can be completely restored after a system restart and pane titles have been around for quite a while now.

I set this in my ~/.tmux.conf
set -g pane-border-status top

to set the title of each pane:
tmux select-pane -t 1 -T title2

Could someone with experience look at the branch conflict and see what the problem is to introduce this basic feature?

@@ -194,6 +194,7 @@ restore_pane() {
else
new_session "$session_name" "$window_number" "$window_name" "$dir" "$pane_index"
fi
tmux select-pane -t "$session_name":"$window_number"."$pane_index" -T "${pane_title}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of naming the pane with a standalone command, can we somehow set the correct pane_title when the pane is created?

@@ -50,6 +50,8 @@ pane_format() {
format+="#{pane_pid}"
format+="${delimiter}"
format+="#{history_size}"
format+="${delimiter}"
format+="#{pane_title}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if we grouped all pane_ interpolations together? Maybe add pane_title after pane_index?

This will be a breaking change when performing a restore with the old resurrect file, but that's a separate concern.

@@ -313,7 +315,7 @@ main() {
start_spinner "Saving..." "Tmux environment saved!"
fi
save_all
if show_output; then
if show_output; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please use tabs for indentation?

I'm also not happy with tabs and would like to change to two-space indentation, but I need help from someone that's willing to do that for all the repos in tmux-plugins github org.

@bruno-
Copy link
Member

bruno- commented Feb 27, 2022

Hi,

I'm in favor of adding this feature, but I don't have time to work on it.

I'll provide support and guidance if anyone is willing to step up and take the ownership of this feature. The code changes in this PR should already work so the next steps would be:

  • Rebase with master
  • Address PR comments
  • Test, test, test
  • Merge if all looks good

@Hologos
Copy link
Contributor

Hologos commented Mar 23, 2022

Hi @bruno-, I'll take care of this PR. Can I somehow continue in this PR or do I have to create a new one?

@Hologos
Copy link
Contributor

Hologos commented Mar 23, 2022

Just a note - for easier migration, I'll check number of saved pane parameters since you don't want the pane title to be last.

@bruno-
Copy link
Member

bruno- commented Mar 24, 2022

I'll take care of this PR

Great!

Can I somehow continue in this PR or do I have to create a new one?

Not sure, I think you have to create your own.

for easier migration, I'll check number of saved pane parameters since you don't want the pane title to be last.

We don't want to litter the plugin source code with migration logic. I'd prefer the pane_title parameter to be on line 51.

@Hologos
Copy link
Contributor

Hologos commented Mar 24, 2022

We don't want to litter the plugin source code with migration logic.

That's a valid point, noted.

I'd prefer the pane_title parameter to be on line 51.

Line 51 has delimiter on it, did you mean 52?

@bruno-
Copy link
Member

bruno- commented Mar 24, 2022

Line 51 has delimiter on it, did you mean 52?

Ah, yes!

@Hologos
Copy link
Contributor

Hologos commented Mar 28, 2022

FYI: There is a bug in restore.sh on line 281 in restore_shell_history() function, there should be $11 instead of $10 since in this version, there is still window_name saved with each pane.

awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ { print $2, $3, $7, $10; }' $(last_resurrect_file) |

@Hologos
Copy link
Contributor

Hologos commented Mar 28, 2022

I have just pushed this PR with fixes.

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

Successfully merging this pull request may close these issues.

6 participants