diff options
| author | theimpostor <sahirhoda@gmail.com> | 2024-11-20 13:33:50 -0600 |
|---|---|---|
| committer | theimpostor <sahirhoda@gmail.com> | 2024-11-20 13:33:50 -0600 |
| commit | da8031e3df21bd20e09b5d600a0a0385e6ce4cc6 (patch) | |
| tree | f11283d5645887eab441b6b0a6f3c93adeee01ee /main.go | |
| parent | 26606665ce3f5b512dc44ea75117a1a586d58142 (diff) | |
Log tty writes in paste
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -338,8 +338,20 @@ func paste() error { } defer closetty(tty) + var ttyWriter io.Writer + if verboseFlag { + ttyWriter = &debugWriter{ + prefix: "tty write", + w: tty, + } + } else { + ttyWriter = tty + } + // Start OSC52 - fmt.Fprint(tty, oscOpen+"?"+oscClose) + if _, err := fmt.Fprint(ttyWriter, oscOpen+"?"+oscClose); err != nil { + return nil, fmt.Errorf("Error writing osc open: %w", err) + } var ttyReader *bufio.Reader if verboseFlag { |
