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
Support Wireshark-like profiles for column preferences, etc #108
Comments
This work is driven by this issue: #108 Here's a description of how everything currently works. Prior to this change, termshark had one config file (per user), stored in a standard location. I'll use Linux as an example - ~/.config/termshark/termshark.toml. With this change, there's a new set of subdirectories, one per profile, containing toml files e.g. after some profiles have been created, you might have: ~/.config/termshark/profiles/classic/termshark.toml ~/.config/termshark/profiles/extracolumns/termshark.toml ~/.config/termshark/profiles/darker/termshark.toml These toml files are the same structure as the default termshark.toml. Termshark starts with the default profile, represented by the default config file (not in the new profiles/ dir). There are two new console commands: (1) :profile -> switch profile to one that exists already When a non-default profile is chosen, the settings in that profile's config file take precedence. If a setting is needed and not set explicitly, termshark falls back to the setting in the default profile. When a setting is explicitly changed, it is changed in the newly activated profile. (2) :new-profile -> create a new profile The user must choose a name that is not in use (and that can be used as a directory name). When created, termshark automatically switches to the new profile. If the profile in use at the time of creation is not the default, termshark copies the previous profile to the new profile and proceeds from there. If the profile in use is the default, the new profile will be empty. When termshark is using a non-default profile, it is shown on the top line of the UI. Termshark can be started with a non-default profile using the new -C/--profile command-line flag. Note that although I chose this to line up with Wireshark's invocation, termshark does not use Wireshark profiles in any way.
Hi @zoulja - I have pushed up an implementation of profiles support in branch Prior to this change, termshark had one config file (per user), stored in a standard location. I'll use Linux as an example - ~/.config/termshark/termshark.toml. With this change, there's a new set of subdirectories, one per profile, containing toml files e.g. after some profiles have been created, you might have:
These toml files are the same structure as the default termshark.toml. Termshark starts with the default profile, represented by the default config file (not in the new There are two new console commands: (1) When a non-default profile is chosen, the settings in that profile's config file take precedence. If a setting is needed and not set explicitly, termshark falls back to the setting in the default profile. When a setting is explicitly changed, it is changed in the newly activated profile. (2) The user must choose a name that is not in use (and that can be used as a directory name). When created, termshark automatically switches to the new profile. If the profile in use at the time of creation is not the default, termshark copies the previous profile to the new profile and proceeds from there. If the profile in use is the default, the new profile will be empty. When termshark is using a non-default profile, it is shown on the top line of the UI. Termshark can be started with a non-default profile using the new |
Here are links to pre-built binaries: And if you would rather build yourself, this should do it:
|
I've made some changes to how this works. Here's info from the main commit: First, when the create-profile UI is opened, a new section at the bottom of the dialog allows making a connection to a Wireshark profile. If the checkbox is ticked, then the drop down button can be used to choose a Wireshark profile. This is saved in termshark.toml (for the current termshark profile) as main.wireshark-profile (string). The effect is that when tshark is invoked e.g. to load the PSML or PDML for a pcap, the -C flag is provided. One practical effect of this is that the Wireshark packet colors the user may have set up under a specific profile are able to be used in termshark. So, this mechanism allows configuration of termshark profiles via a connection to a Wireshark profile. Note that most Wireshark settings are not adopted in this way; for example, column can be configured in Wireshark, but termshark does this and stores them in the user's current termshark profile. You can change column sets by changing termshark profile, but they are stored by termshark in its config and not consumed from Wireshark's config. The second change reworks the profile minibuffer commands. Instead of profile and new-profile, there is a multi-level profile command:
|
Now that v2.4 is out with support for profiles, I'll close this. |
This is a suggestion from termshark user @zoulja.
The priority for the first iteration is columns; after that I will consider other config info, following Wireshark's lead.
The text was updated successfully, but these errors were encountered: