mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
lp.Println() should act live fmt.Println()
also use a dedicated error type for signalining perm denied
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"time"
|
||||
|
||||
"kitty"
|
||||
"kitty/kittens/unicode_input"
|
||||
"kitty/tools/cli/markup"
|
||||
"kitty/tools/rsync"
|
||||
"kitty/tools/tty"
|
||||
@@ -535,7 +536,7 @@ func (self *manager) on_file_transfer_response(ftc *FileTransmissionCommand) (er
|
||||
if ftc.Status == `OK` {
|
||||
self.state = state_waiting_for_file_metadata
|
||||
} else {
|
||||
return os.ErrPermission
|
||||
return unicode_input.ErrCanceledByUser
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf(`Unexpected response from terminal: %s`, ftc.String())
|
||||
@@ -819,7 +820,7 @@ func (self *handler) on_file_transfer_response(ftc *FileTransmissionCommand) (er
|
||||
}
|
||||
transfer_started := self.manager.state == state_transferring
|
||||
if merr := self.manager.on_file_transfer_response(ftc); merr != nil {
|
||||
if merr == os.ErrPermission {
|
||||
if merr == unicode_input.ErrCanceledByUser {
|
||||
// terminal will not respond to cancel request
|
||||
return fmt.Errorf("Permission denied by user")
|
||||
}
|
||||
|
||||
@@ -202,8 +202,8 @@ func (self *Loop) KillIfSignalled() {
|
||||
}
|
||||
|
||||
func (self *Loop) Println(args ...any) {
|
||||
self.QueueWriteString(fmt.Sprint(args...))
|
||||
self.QueueWriteString("\r\n")
|
||||
self.QueueWriteString(fmt.Sprintln(args...))
|
||||
self.QueueWriteString("\r")
|
||||
}
|
||||
|
||||
func (self *Loop) SprintStyled(style string, args ...any) string {
|
||||
|
||||
Reference in New Issue
Block a user