abrochard / kubel

Emacs extension for controlling Kubernetes with limited permissions
GNU General Public License v3.0
259 stars 41 forks source link

Allow for customization of shell buffer names #121

Closed murshies closed 5 months ago

murshies commented 7 months ago

This change adds a new customizable variable, called kubel-shell-buffer-name-format. This variable defines the buffer name format for shell, ansi-term, eshell, and vterm buffers created through kubel-exec-popup. I frequently have to interact with multiple clusters and multiple namespaces in each cluster, so having the ability to add the Kubernetes context and namespace to the buffer name is useful. As explained in the documentation for kubel-shell-buffer-name-format, the following %-sequences are available:

%t: The shell type. Examples of this are shell and eshell %c: The container name %p: The pod name %n: The current namespace %C: The current context

I set the default format to "kubel:%C:%n:%t:%c@%p", which updates the shell buffer name format to match the new buffer name format after the merge of https://github.com/abrochard/kubel/pull/114.

abrochard commented 6 months ago

Thank you for submitting this! I like the idea and will take the time to review and test. In the meantime, I just merged #114 which was a long waiting feature. Would you mind giving it a look and seeing if there's overlap with what you're trying to do?

murshies commented 6 months ago

Thank you for submitting this! I like the idea and will take the time to review and test. In the meantime, I just merged #114 which was a long waiting feature. Would you mind giving it a look and seeing if there's overlap with what you're trying to do?

That is a great update! I tried it out and I see that the buffer name format hasn't changed for shells, so I think it would be good to still have an update like this. I did make one edit to my pull request based on https://github.com/abrochard/kubel/pull/114 - I updated the default for kubel-shell-buffer-name-format so that it better matches the buffer name format that is now being used. Let me know what you think!

murshies commented 5 months ago

Thank you!

Thanks for merging! I noticed this was mentioned in #114 about customizing different buffer names. If you think doing something similar to this would be helpful for other buffer types, I'd be happy to work on that. Let me know!

abrochard commented 5 months ago

Thanks for merging! I noticed this was mentioned in #114 about customizing different buffer names. If you think doing something similar to this would be helpful for other buffer types, I'd be happy to work on that. Let me know!

Thank you for proposing! I think it's entirely up to you! I'm personally still playing around with the latest kubel and it works for me so far. It's a good idea but at least to me it's not urgent. So if you want to work on it, I will happily review. But really no pressure.