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

auto-focus logs when pod is selected #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frudolph77
Copy link

auto-focus logs when pod is selected.
From my point of view, a very useful feature.

@astefanutti
Copy link
Owner

astefanutti commented Nov 15, 2020

I can see it's useful in some use cases. On the other hand, I can also see use cases where it's not ideal. For example, with pods having more than one containers. One idea could be to focus the log element only when the Shift key or Alt key has also been pressed?

@frudolph77
Copy link
Author

As far as I understand the code blessed does not support key Alt key. And I also did not get a binding like Shift+Enter or Ctrl+Enter working.

@astefanutti
Copy link
Owner

It should be possible to test for key.shift or key.meta in the listener. If the listener is not called, it's possible the terminal emulator you use already have a key binding for the combination.

@frudolph77
Copy link
Author

It should be possible to test for key.shift or key.meta in the listener.

Yes, i know.

I've added this code to dashboard.js:

    pods_table.key(['S-enter', 'C-enter', 'enter'], (_, key) => {
      debug.log("pods_table.key('enter') : '" + JSON.stringify(key) +"'");
    });
    
    screen.on('keypress', function(key) {
      debug.log("screen.on('keypress') : '" + JSON.stringify(key) +"'");
    });

The keypress-Event always gets fired twice when pressing enter and shows \r as output, only the Alt Key is also displayed.
The pods_table.key only shows the enter key, neither with shitft nor with ctrl.

I'm pretty sure that there is no keybinding for Shift-Enter or Control-Enter in my terminal.

@astefanutti
Copy link
Owner

OK, thanks. I'll have a deeper look at it ASAP.

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.

2 participants