mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
clipboard kitten: Dont set clipboard when getting clipboard
The previous behavior meant getting the clipboard would first empty it if STDIN was null or empty which can easily happen when run non-interactively. Fixes #6302
This commit is contained in:
@@ -48,6 +48,8 @@ Detailed list of changes
|
|||||||
|
|
||||||
- clipboard kitten: Fix a bug causing the last MIME type available on the clipboard not being recognized when pasting
|
- clipboard kitten: Fix a bug causing the last MIME type available on the clipboard not being recognized when pasting
|
||||||
|
|
||||||
|
- clipboard kitten: Dont set clipboard when getting clipboard in filter mode (:iss:`6302`)
|
||||||
|
|
||||||
- Fix regression in 0.28.0 causing color fringing when rendering in transparent windows on light backgrounds (:iss:`6209`)
|
- Fix regression in 0.28.0 causing color fringing when rendering in transparent windows on light backgrounds (:iss:`6209`)
|
||||||
|
|
||||||
- show_key kitten: In kitty mode show the actual bytes sent by the terminal rather than a re-encoding of the parsed key event
|
- show_key kitten: In kitty mode show the actual bytes sent by the terminal rather than a re-encoding of the parsed key event
|
||||||
|
|||||||
@@ -99,7 +99,9 @@ func run_plain_text_loop(opts *Options) (err error) {
|
|||||||
stdin_is_tty := tty.IsTerminal(os.Stdin.Fd())
|
stdin_is_tty := tty.IsTerminal(os.Stdin.Fd())
|
||||||
var data_src io.Reader
|
var data_src io.Reader
|
||||||
var tempfile *os.File
|
var tempfile *os.File
|
||||||
if !stdin_is_tty {
|
if !stdin_is_tty && !opts.GetClipboard {
|
||||||
|
// we dont read STDIN when getting clipboard as it makes it hard to use the kitten in contexts where
|
||||||
|
// the user does not control STDIN such as being execed from other programs.
|
||||||
data_src, tempfile, err = preread_stdin()
|
data_src, tempfile, err = preread_stdin()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ Read or write to the system clipboard.
|
|||||||
|
|
||||||
This kitten operates most simply in :italic:`filter mode`.
|
This kitten operates most simply in :italic:`filter mode`.
|
||||||
To set the clipboard text, pipe in the new text on :file:`STDIN`. Use the
|
To set the clipboard text, pipe in the new text on :file:`STDIN`. Use the
|
||||||
:option:`--get-clipboard` option to output the current clipboard text content to
|
:option:`--get-clipboard` option to instead output the current clipboard text content to
|
||||||
:file:`STDOUT`. Note that copying from the clipboard will cause a permission
|
:file:`STDOUT`. Note that copying from the clipboard will cause a permission
|
||||||
popup, see :opt:`clipboard_control` for details.
|
popup, see :opt:`clipboard_control` for details.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user