Skip to content
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

Mark-Range bug #1191

Closed
pemmasanikrishna opened this issue Jul 8, 2021 · 12 comments · Fixed by #2881
Closed

Mark-Range bug #1191

pemmasanikrishna opened this issue Jul 8, 2021 · 12 comments · Fixed by #2881
Labels
bug Something isn't working

Comments

@pemmasanikrishna
Copy link

pemmasanikrishna commented Jul 8, 2021

In window machine, mark range is not working as expected. When ctrl-space is used on 2 resources separated with some resources in between, and then when ctrl-d is used, only the first and last resource are being selected for the delete.

@derailed derailed added the bug Something isn't working label Nov 16, 2021
@dracan
Copy link

dracan commented Sep 9, 2022

To add to this - only the first and last items are highlighted in green too (indicating that they're the only ones selected). So it looks like ctrl-space is literally just doing the same as what space does.

(I'm on Windows too)

@ralgozino
Copy link

Same here on macos. I'm pretty sure in older versions ctrl+space worked, I don't know since when but now pressing ctrl+space doesn't do anything

@b8kings0ga
Copy link

right, at macos seems is not doing anything

@ralgozino
Copy link

ralgozino commented Mar 29, 2023

The problem (in my case at leasta) was that macos by default assigns ctrl+space as a shortcut to change the input layout (keyboard language). Disabling the shortcut in macos settings made the range selection work on k9s.

@b8kings0ga
Copy link

thank you for reply. I actually realized that macos using the same shortcut, but I thought the shortcut is ctrl+space+up/down, when I push ctrl+space nothing happend. and also, I didn't find a way to change that perticular shortcut on macos at keyboard shortcut session

@ralgozino
Copy link

When I pressed ctrl+space nothing happened also, because I only had one language set up (I guess this is your case also), if you add a second language to your keyboard layout and press ctrl+space you'll switch between them.

You need to go to System Settings -> Keyboard -> Keyboard Shortcuts -> Input Sources:

image

The screenshot is from Ventura, but in Monterrey and the option was there also.

@b8kings0ga
Copy link

b8kings0ga commented Mar 30, 2023

sorry I didn't post the updated image,I disabled my shortcut, but still not working

image

however, my case is that, Im using k9s over a web terminal (using xterm), because other shortcut works so I don't know if that makes any difference

my k9s version:
____ .______
| |/ / __ _____
| < ____ / /
| | \ / /_

|
|__ \ ///___ >
/ /

Version: v0.25.18
Commit: 6085039
Date: 2021-12-28T16:53:21Z

@Bec-k
Copy link

Bec-k commented Oct 6, 2023

Does not work for me also.

@ForbiddenEra
Copy link

ForbiddenEra commented Feb 20, 2024

Note: I discovered some things shortly after initially posting; please read the Edit comments

Little confused here, in help, I see <ctrl-space> as kube-system (which I assume from the description switches to the kube-system namespace, which I was trying to use to keep it out of my namespace favorites list) and also under RESOURCE and also <ctrl-space> as Mark Range under GENERAL

I'm guessing from the help that the Mark Range action is context sensitive and is only activated if one has marked a resource, whereas otherwise it would, as I assume, switch to the kube-system namespace.

Edit 4: Seems like <ctrl-space> was assigned to kube-system since that was the last namespace above 10 in my favorites, I thought this was a built in feature with kube-system being such a common namespace. Seems odd how namespaces above 10, besides the last one, are ignored? But this hotkey does not work, for any namespace I've set.

For me, I'm on Win10, using Windows Terminal (Preview) to ssh into a local WSL instance - since most others who've mentioned the issue are on MacOS but I am not, perhaps there's a deeper or other issue?

Admittedly, I haven't done a full dig to ensure that <ctrl-space> isn't defined anywhere on my system as a hot key; however, if that IS the case for the MacOS users and even myself, perhaps there should be some configuration settings/options to change/override the default hotkeys?

Edit: I've checked with showkey -a and indeed <ctrl-space> is sent to the terminal (at least for my WSL instance, doesn't seem to make it for ssh connections but that's a separate issue):

#> showkey -a

Press any keys - Ctrl-D will terminate this program

^@        0 0000 0x00

Perhaps the issue is how the key is handled..? As in looking specifically somehow for <ctrl-space> and not 0x00/^@ as is common?

The NULL character (code 0) is represented by Ctrl-@, "@" being the code immediately before "A" in the ASCII character set.
For convenience, a lot of terminals accept Ctrl-Space as an alias for Ctrl-@.

Edit 2: Hmm, maybe not? I tried in an xterm window (same WSL instance) and it did work and inside that window, skowkey -a shows ^@ as expected...

Edit 3: I was trying some things in the xterm and realized that the kube-system action never seemed to work, then I tried the Mark Range again and it didn't work, which confused me. Then I noticed the Mark Range was only working on the namespace select list - then I went back and checked in my normal terminal and indeed, Mark Range worked fine in the namespace list but not elsewhere!

I do see that setting custom hotkeys is a possibility and, at least in the kube-system use-case, should be easy to apply the same effect to a key of my choosing, however, I'd have to do so by using existing commands that can be typed/bound. That seems to make it impossible to create a hotkey to perform an inbuilt action, such as the Mark Range example.

Also, as mentioned I assume that the kube-system action would filter the currently selected/displayed resource; I may be missing something (new to k9s) but I'm not sure it's possible to just switch the current namespace by command, intuitively I would've guessed typing :ns new-namespace would switch, however, using the :ns command without any argument or with any namespace as an argument both brings me to the namespace list, seems like it's oddly missing the ability to use an argument like most other commands, thus I don't think I could actually manage similar functionality with a defined hotkey in that case either.

Especially as it seems like currently namespace favorites are limited to 10 options (and since there's seemingly a hotkey for it) having kube-system in my favorites feels like a waste.

As an aside, that limitation feels a bit odd when all 10 favorites are listed in two un-even columns, as if there could be more.

That limitation is likely due to the default-assigned hotkeys for the favorites using numbers 0-9 but I'm sure there's favorable solutions for that, such as using a modifier for the next 10 (eg. ctrl-0, ctrl-1, etc) or rolling over to the symbols under the numbers (10 being !, 11 being @, etc) although unless you're checking keyboard layouts to decide which symbols to use, users with different layouts would see it as less intuitive or potentially annoying.

Another great option to lessen the impact of such a limit would be allowing wildcards/glob/regex to be used for favorites.

@intonet
Copy link

intonet commented May 10, 2024

Edit 4: Seems like <ctrl-space> was assigned to kube-system since that was the last namespace above 10 in my favorites, I thought this was a built in feature with kube-system being such a common namespace. Seems odd how namespaces above 10, besides the last one, are ignored? But this hotkey does not work, for any namespace I've set.

I can confirm that. Where is more than 10 namespaces in latest/favorites then ctrl+space shortcut conflict mark range.
Fixed by deleted some favorites namespaces in config.yaml under Library/Application Support/k9s/clusters/cluster_name.

@jkleckner
Copy link

I can confirm that. Where is more than 10 namespaces in latest/favorites then ctrl+space shortcut conflict mark range. Fixed by deleted some favorites namespaces in config.yaml under Library/Application Support/k9s/clusters/cluster_name.

At the risk of "me too", deleting the > 10 favorites fixed this for me. I think the priority for this should be high.
The absence of a working mark-select feature cost me time manually deleting a large number of stuck pods.
When I had the time to figure out why it didn't work, I ended up here.
Would love prioritizing a fix for this.

@g-hodgson-tup
Copy link

I'm seeing this problem too (v0.32.5 in WSL2).

Sadly deleting the favourites did not solve the problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants