Skip to content

Commit

Permalink
Include any provided capture filter in the UI
Browse files Browse the repository at this point in the history
The pcap or live packet source is displayed in termshark's title bar. If
a capture filter is provided at the command-line when termshark is
invoked, its displayed in parentheses after the name of the live
source.
  • Loading branch information
gcla committed Jan 9, 2021
1 parent 1b8b357 commit 8821427
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/prochandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ func MakeUpdateCurrentCaptureInTitle() updateCurrentCaptureInTitle {

func (t updateCurrentCaptureInTitle) BeforeBegin(code pcap.HandlerCode, app gowid.IApp) {
if code&pcap.PsmlCode != 0 {
currentCapture.SetText(t.Ld.String(), app)
cap := t.Ld.String()
if t.Ld.CaptureFilter() != "" {
cap = fmt.Sprintf("%s (%s)", cap, t.Ld.CaptureFilter())
}
currentCapture.SetText(cap, app)
currentCaptureWidgetHolder.SetSubWidget(currentCaptureWidget, app)
}
}
Expand Down

0 comments on commit 8821427

Please sign in to comment.