Skip to content

Commit

Permalink
Bug Fix: #116 - Removed selection mode in Wayland session (temp)
Browse files Browse the repository at this point in the history
  • Loading branch information
F1bonacc1 committed Jan 13, 2024
1 parent ceb8005 commit 1a4a1b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,8 @@ func isClient() bool {
}
return false
}

func IsLogSelectionOn() bool {
_, found := os.LookupEnv("WAYLAND_DISPLAY")
return !found
}
11 changes: 9 additions & 2 deletions src/tui/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ func (pv *pcView) onAppKey(event *tcell.EventKey) *tcell.EventKey {
pv.logsText.ToggleWrap()
pv.updateHelpTextView()
case pv.shortcuts.ShortCutKeys[ActionLogSelection].key:
if !config.IsLogSelectionOn() {
return event
}
pv.stopFollowLog()
pv.toggleLogSelection()
pv.appView.SetFocus(pv.logsTextArea)
Expand Down Expand Up @@ -319,15 +322,19 @@ func (pv *pcView) updateHelpTextView() {
pv.shortcuts.ShortCutKeys[ActionLogFind].writeButton(pv.helpText)
pv.shortcuts.ShortCutKeys[ActionLogFindNext].writeButton(pv.helpText)
pv.shortcuts.ShortCutKeys[ActionLogFindPrev].writeButton(pv.helpText)
pv.shortcuts.ShortCutKeys[ActionLogSelection].writeToggleButton(pv.helpText, !pv.logSelect)
if config.IsLogSelectionOn() {
pv.shortcuts.ShortCutKeys[ActionLogSelection].writeToggleButton(pv.helpText, !pv.logSelect)
}
pv.shortcuts.ShortCutKeys[ActionLogFindExit].writeButton(pv.helpText)
return
}
fmt.Fprintf(pv.helpText, "%s ", "[lightskyblue:]LOGS:[-:-:-]")
pv.shortcuts.ShortCutKeys[ActionLogScreen].writeToggleButton(pv.helpText, logScrBool)
pv.shortcuts.ShortCutKeys[ActionFollowLog].writeToggleButton(pv.helpText, !pv.logFollow)
pv.shortcuts.ShortCutKeys[ActionWrapLog].writeToggleButton(pv.helpText, !pv.logsText.IsWrapOn())
pv.shortcuts.ShortCutKeys[ActionLogSelection].writeToggleButton(pv.helpText, !pv.logSelect)
if config.IsLogSelectionOn() {
pv.shortcuts.ShortCutKeys[ActionLogSelection].writeToggleButton(pv.helpText, !pv.logSelect)
}
pv.shortcuts.ShortCutKeys[ActionLogFind].writeButton(pv.helpText)
fmt.Fprintf(pv.helpText, "%s ", "[lightskyblue::b]PROCESS:[-:-:-]")
pv.shortcuts.ShortCutKeys[ActionProcessScale].writeButton(pv.helpText)
Expand Down

0 comments on commit 1a4a1b4

Please sign in to comment.