-
Notifications
You must be signed in to change notification settings - Fork 445
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
Adds support for saving and restoring pane titles. #431
Conversation
TODOs:
|
Sadly it's not possible, I created a function that is called within |
e0d8299
to
a516947
Compare
Last commit reverts to setting |
scripts/restore.sh
Outdated
@@ -302,7 +312,7 @@ restore_window_properties() { | |||
} | |||
|
|||
restore_shell_history() { | |||
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ { print $2, $3, $6, $9; }' $(last_resurrect_file) | | |||
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ { print $2, $3, $6, $10; }' $(last_resurrect_file) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to get rid of this feature for a long time
https://github.com/tmux-plugins/tmux-resurrect/blob/master/docs/restoring_shell_history.md
Please don't fix this, I'll remove "restore shell history" after we merge restoring pane titles feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean I should revert all changes in restore_shell_history()
as well as dump_shell_history()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please.
I'll remove the whole "shell history" feature after we merge this branch.
scripts/restore.sh
Outdated
@@ -200,6 +209,7 @@ restore_pane() { | |||
else | |||
new_session "$session_name" "$window_number" "$dir" "$pane_index" | |||
fi | |||
set_pane_title "$session_name" "$window_number" "$pane_index" "$pane_title" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_pane_title
function effectively contains only a single line/single command, and it's called from just one place.
My first thought was why not just inline it? If you think the function name makes it obvious what the cryptic tmux command does, we can also add a comment.
But, if you want to keep the function, that's fine too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a remnant of previous commits where I tried to call it when creating panes. I agree to just inline the command.
@Hologos thank you for working on this.
I'd prefer if we inlined that function, but I'm ok if you really want to keep I left a couple small comments, but overall this looks good to me. Can you please ping me after you make the final tweaks? I'll then test this myself for a couple days, and then we can merge. |
I've been using it for a week now, resurrected several times + tested it the day I made the changes. We can test it for longer, I am able to rebase it if any changes gets merged into master. |
Great. I'll start using it after you make the final tweaks. We can merge this after a couple days if all looks good. |
@bruno- I've made requested changes. Thank you for your time. |
Thanks. I pulled this branch locally. Testing basic save/restore looks good. I'll continue working with it for the next couple days. |
@Hologos this PR is ready for the merge. Since this feature contains breaking changes I'll have to release a new major version. That's done by tagging the commit with breaking changes with a new major version So, can you please squash the commits from this branch in a single commit? Thanks |
92042b7
to
1ad109d
Compare
@bruno- Hi, I squashed them into a single one. Cheers |
Thank you for working on this feature. Is this ready to test yet? |
I would love to try this. I see version 4.0 was release 16 days ago. Does this version contain the change? I did not see a changelog on the release page. |
@ioogithub The feature is part of v4.0 release. |
This PR is a rebase of #342 with addressed PR comments, fixes for
restore_shell_history()
anddump_shell_history()
. It fixes #330 as well.I am currently testing it but pls test it thoroughly yourself.
It is a breaking change so I added a comment to the changelog.