Skip to content

Conversation

@danvergara
Copy link
Owner

Fix flags logic in the cmd/root.go file

Description

Some user have reported some issues related to the lack of the default values for the keybindings in #269. I just found out that the --config and the --keybdings were not really independent, so I made sure they are now, and I made sure the keybindings are always set, no matter what.

Fixes #269

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

I QA'd the changes manually.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

@danvergara danvergara force-pushed the fix-keybindings-loading branch from 6b12e52 to 943a12e Compare October 21, 2025 20:52
@karthickkannankrish
Copy link
Contributor

karthickkannankrish commented Oct 22, 2025

still I can't execute the query when pressing ctrl+space.
When I press backspace in the query editor it switch or focus to tables view and release version executable works fine when pressing backspace.

@danvergara
Copy link
Owner Author

Can you log the event?

@karthickkannankrish
Copy link
Contributor

select * from device

select
event = &tcell.EventKey{t:time.Time{wall:0xc2362d19ecde3bc8, ext:7111079401, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:115}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d19f38b0370, ext:7223066001, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:101}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1a01c3b06c, ext:7387919501, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:108}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1a08148f90, ext:7493882801, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:101}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1a17a3e528, ext:7754934601, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:99}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1a25cf4688, ext:7992658601, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:116}

space
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1a2eb81a54, ext:8142134901, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:32}

star
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1c52734ff8, ext:16667864601, loc:(*time.Location)(0x7ff61856dca0)}, mod:1, key:256, ch:42}

space
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1c65d5a30c, ext:16993075501, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:32}

from
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1c6aa99a78, ext:17074075801, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:102}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1c7a9bcf64, ext:17341607301, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:114}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1c832ca198, ext:17411574201, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:111}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1c8e3bc258, ext:17597115001, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:109}

space
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1c97f54e90, ext:17760270001, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:32}

device
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1c9fe03d18, ext:17893107001, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:100}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1cae751e48, ext:18137745001, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:101}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1cc0eebad8, ext:18373963001, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:118}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1cc91b3aec, ext:18511097101, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:105}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1cce47cb98, ext:18597903801, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:99}
event = &tcell.EventKey{t:time.Time{wall:0xc2362d1cde3ba0ec, ext:18865541901, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:256, ch:101}

ctrl+space
event = &tcell.EventKey{t:time.Time{wall:0xc2362d22ef6d8eac, ext:43154026701, loc:(*time.Location)(0x7ff61856dca0)}, mod:2, key:32, ch:0}

backspace
event = &tcell.EventKey{t:time.Time{wall:0xc2362d5fac1f9588, ext:286098585001, loc:(*time.Location)(0x7ff61856dca0)}, mod:0, key:8, ch:8}

@danvergara
Copy link
Owner Author

But what about the keybindings at that moment?

@karthickkannankrish
Copy link
Contributor

Other keybindings are working for me only ctrl+space and backspace is not working.

@danvergara
Copy link
Owner Author

Going over the tcell's event key values, I just realized that Ctrl+Space should be 0 and you get 32. Have you tried to override the RunQuery value with something else?

When it comes to the KeyBackspace, there's an overlap with KeyCtrlH, but for some reason it is not a problem on my end, on Fedora.
image

@karthickkannankrish
Copy link
Contributor

I haven't tried remapping the runquery key. I will try and let you know.
yeah ctrl keys are overlapping.

@karthickkannankrish
Copy link
Contributor

karthickkannankrish commented Oct 22, 2025

I am able to execute the query and view the result when I remap the runQuery to Ctrl+G.

@danvergara
Copy link
Owner Author

There you go!
That's what keymaping is for, when you need to remap keys becuase either an overlap or the OS gets the key wrong.

@danvergara danvergara merged commit 38c5643 into main Oct 22, 2025
4 checks passed
@danvergara danvergara deleted the fix-keybindings-loading branch October 22, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

keybindings not working

3 participants