Skip to content

Commit

Permalink
Merge pull request #12 from techygrrrl/bugfix/10-wrong-pid-filtered-2
Browse files Browse the repository at this point in the history
  • Loading branch information
savannahostrowski committed May 8, 2023
2 parents fe15e27 + 13f1ad7 commit f21e3e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
} else {
// If accepted killing the port, grab PID + execute killPort()
if m.activeButton == "yes" {
m.list.ResetFilter()
rgx := regexp.MustCompile(`\((.*?)\)`)
pid := rgx.FindStringSubmatch(m.list.SelectedItem().FilterValue())[1]
killPort(pid)
// Get running processes again when a process is killed
m.list.SetItems(getProcesses())
m.list.ResetFilter()
}
// In all cases, reset selected port at the end
m.selectedPort = ""
Expand Down

0 comments on commit f21e3e1

Please sign in to comment.