Code Monkey home page Code Monkey logo

kitty_grab's People

Contributors

acksld avatar alkim0 avatar amfern avatar gnashcraft avatar sighery avatar yurikhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kitty_grab's Issues

Exception thrown by runner.py on startup

Thanks for this kitten. It adds a great missing feature to kitty.

Issue

Exception is thrown directly after triggering the hotkey for the grab action.

Unhandled exception running kitten:
Traceback (most recent call last):
  File "kitty/runner.py", line 142, in main
  File "kitty/runner.py", line 68, in launch
TypeError: main() takes 0 positional arguments but 1 was given
Press Enter to quit...

System

kitty 0.12.3

Replicate

Minimal user configuration in kitty.conf:

map ctrl+space kitten grab1.py

Exception on runtime

Issue

Immediately after triggering the hotkey the following exception occurs:

Exception in callback Loop._read_ready(<kitten.GrabH...t 0x10ae3eeb8>, 6)
Traceback (most recent call last):
  File "Python/events.py", line 88, in _run
  File "kitty/loop.py", line 188, in _read_ready
  File "kitty/loop.py", line 265, in _on_apc
  File "/Users/coby/.config/kitty/grab2.py", line 273, in on_key
    action = self.shortcut_action(key_event)
  File "kitty/handler.py", line 37, in shortcut_action
AttributeError: 'GrabHandler' object has no attribute '_key_shortcuts'

Press the Enter key to quit

The only version of kitty I've tested this on is 0.13.2, but I haven't been able to get it to work in 0.13.0.

Does not work on Kitty ≥0.21.0

When running I'm getting the error:

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/bin/../lib/kitty/__main__.py", line 136, in <module>
    main()
  File "/usr/bin/../lib/kitty/__main__.py", line 127, in main
    namespaced(['+', first_arg[1:]] + sys.argv[2:])
  File "/usr/bin/../lib/kitty/__main__.py", line 84, in namespaced
    func(args[1:])
  File "/usr/bin/../lib/kitty/__main__.py", line 71, in run_kitten
    rk(kitten)
  File "/usr/bin/../lib/kitty/kittens/runner.py", line 124, in run_kitten
    m = runpy.run_path(path, init_globals={'sys': sys, 'os': os}, run_name='__run_kitten__')
  File "/usr/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/axel/.config/kitty/kitty_grab/grab.py", line 3, in <module>
    import _grab_ui
ModuleNotFoundError: No module named '_grab_ui'  

even though _grab_ui.py is in that folder. Any idea why?

[feat] change (dim) background color

I would like some indication that I am currently in grab mode. I have the top window bar disabled, so changing the background for example would be a nice way to do that.

I only see

#: Colors {{{

# selection_foreground #FFFFFF
# selection_background #5294E2

#: Colors for selected text while grabbing.

#: }}}

the selection color in the example config.

New error after kitty upgrade, cannot import name 'key_func'

Still not sure if it's directly related to the update, need to look into it some more, but thought i'd leave this here for your information, and just in case you have any advice re: dealing with it. LOVE this plugin btw, keep up the awesome work!

CleanShot 2022-01-07 at 13 24 56@2x

Key action failed

kitten kitty_grab/grab.py
cannot import name 'key_func' from 'kitty.conf.utils'

Press Enter to close.

Question: how do you make the Ansi color displayed flawlessly? and can I do it in vim?

My goal for me to make his copy mode work is always to try to use vim key-binding as my top priority. So I did bunch of tries:

  1. Load a customised vimrc and config kitty to use it as pager
  2. Use AnsiEsc plugin to try to keep the color

However it works partially but not entirely, which will depends on what programs actually does the coloring in the first place. Some lines have been restored perfectly, some lines are either not or partially restored.

So my question is, can I borrow your implementation of "intact" of the original buffer and apply the same to my approach above? Not sure if you have tried using vim, you might have, if so, would you please just teach me the lesson so that I won't bump to the wall again.

Thanks

select stream adds newline on display linebreak

When I do stream selection (shift + arrows with default bindings) on a output line which is displayed on the terminal in multiple lines (due to being too long) I get a newline inserted at the point where the display breaks the line. This doesn't happen when I select using the mouse.

Copy/paste not working

I just installed kitty_grab but is not working

-Press mapped key
-Kitty flashes
-Change title to "grab"
-Select text
-Press enter
-But when trying to paste, it paste what is already on de clipboard no the selection I just made.

$ kitty -v kitty 0.27.1 created by Kovid Goyal
Windows system X11

Bugs report

Firstly, this is great plugin for kitty, thanks for the work, it is what I am looking for.

There are quite a few things don't work quite right at moment.

I can only manage to fine tune and customise keys, like j/k/h/l for cursor movement, y to yank, the other mappings I have tried hard, but none worked or behaved in weird way. And it is better to mimic the key bindings by default in vim style

Here are a few things I think it requires more work:

a. page up/down, ctrl+f/b
b. v for visual selection mode, if it is possible
c. the column selection just does not work. In fact, I enable alt key in my mac, and none of the mapping using alt key works. Not sure why.
d. not sure how to do search, or if this is possible.

Thank you

Text colour is not inverted unless using 'block' shape cursor

In my kitty.conf, I have:

cursor none
cursor_text_color background 
cursor_shape block
cursor_beam_thickness 3
cursor_blink_interval 0

Note that cursor_text_color background should do nothing because the above is set to cursor none. If I comment it out, there is no change to any of the following. It's just there for completeness, I guess.... but it's superfluous.

The result when I use kitty_grab is as you'd expect - the cursor 'inverts' the background and foreground colours. Here's a shot (look at the 'y' in the middle:

image

So that's nice, and working as expected. But I'd kinda like to be using the beam cursor. When I use beam, it uses the text foreground colour as the foreground of the beam, but doesn't use the text background colour as the text foreground colour, so instead of 'blue on black' becoming 'black on blue' as per the above shot, I get 'blue on blue' which means the text is invisible. screenshot:

image

I chose the lowercase letter y on purpose, so that you can see that the 'underline' cursor has the same issue:

image

I'll just keep using block for now, but it would be super cool if you know how to fix this up, so that I can switch to beam :)

Thanks in advance for any help!

Feature request: multi-line vertical scroll

As far as I am aware scrolling vertically can only be done one line on each keypress ('up'/'down') or one screen height ('page up'/'page down'). Thus I find it tedious to navigate to a line at the middle of the screen. A big improvement would be to allow binding keys to multi-line cursor movements, either by a fixed number of lines or a fraction of the screen height.

Select the whole line with a single short cut

Is there any shortcut to select the whole current line?

The current way I'm doing it is to use 'a' to go the the beginning and then shift+e to go to the end. Not sure if it is the most efficient way.

Feature request- Select whole words and other selection options

@yurikhan

kitty-grab works great! Thank you! I found your documentation easy to follow. kitty-grab should be included in kitty itself. I detest using my mouse to copy text.

I'd like to use kitty-grab just as I use following standard text selection features on my Linux machine when I use Google Docs, Mousepad, SpaceFM, LibreWriter, etcetera...

  1. Shift+Ctrl+Right to select one word to the right.
  2. Shift+Ctrl+Left to select one word to the left.
  3. Shift+End to select from the current cursor position to the end of the line.
  4. Shift+Home to select from the current cursor position to the beginning of the line.
  5. Shift+Ctrl+End to select from the current cursor position to the end of the "document."
  6. Shift+Ctrl+Home to select from the current cursor position to the beginning of the "document."

Thanks,

Yekutiel

Word motion is not grapheme-aware

Ctrl+/ works by looking at code points, but should really use extended grapheme clusters as defined by UAX #29.

Two examples that work incorrectly that come to mind:

  • words containing combining diacritic characters
  • emoji sequences using skin tone modifiers or zero-width joiner

Vim style movement

Is it possible through configuration to make the movement vim style (for example like alacritty's ctrl+shift+space)

Stopped working in kitty 0.17.0

I've updated kitty today to 0.17.0 on macOS and kitty_grab stopped working. I've also updated some configs kitty.conf meanwhile, so not sure is it the update itself or something else. How can I properly debug this extension?

Unable to map ctrl+d?

I'm trying to map:

map Ctrl+d      move page down

in grab.conf, but it seems to not be working.

All other shortcuts, such as:

map Ctrl+f      move page down

works fine. Just not ctrl+d.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.