diff --git a/bookmarks.html b/bookmarks.html new file mode 100644 index 0000000..7392fd3 --- /dev/null +++ b/bookmarks.html @@ -0,0 +1,27 @@ + + + +Links bookmarks + +

Links bookmarks

+ +

+

Links

+
+

English

+
+
Calibration Procedure +
Links Homepage +
Links Manual +
+

Cesky

+
+
Kalibracni procedura +
Links: domaci stranka +
Manual k Linksu +
+
+

+ diff --git a/internal/backend/tmux/session.go b/internal/backend/tmux/session.go index 37f671b..83bbe68 100644 --- a/internal/backend/tmux/session.go +++ b/internal/backend/tmux/session.go @@ -287,7 +287,10 @@ func (s *Session) Send(ctx context.Context, prompt string) (string, error) { return "", fmt.Errorf("send literal failed: %w", err) } - // Send Enter + // Small delay to ensure tmux processes the literal text before sending submit + time.Sleep(200 * time.Millisecond) + + // Send Enter (C-m) to submit the prompt if err := sendKeys(s.target(), "C-m"); err != nil { s.mu.Lock() s.state = "idle" @@ -389,11 +392,25 @@ func (s *Session) SendAsync(ctx context.Context, prompt string) error { target := s.target() + debug.Log("[session %s] SendAsync: target=%s prompt=%q", s.id, target, prompt) + // Send without waiting for completion if err := sendLiteral(target, prompt); err != nil { + debug.Log("[session %s] SendAsync: sendLiteral failed: %v", s.id, err) return err } - return sendKeys(target, "C-m") + debug.Log("[session %s] SendAsync: sendLiteral succeeded, sending Enter", s.id) + + // Small delay to ensure tmux processes the literal text before sending submit + time.Sleep(200 * time.Millisecond) + + // Send Enter (C-m) to submit the prompt + if err := sendKeys(target, "C-m"); err != nil { + debug.Log("[session %s] SendAsync: sendKeys failed: %v", s.id, err) + return err + } + debug.Log("[session %s] SendAsync: sendKeys succeeded", s.id) + return nil } func (s *Session) SendStream(ctx context.Context, prompt string) (io.ReadCloser, error) { diff --git a/internal/p9/server.go b/internal/p9/server.go index 7f05d51..290c9c7 100644 --- a/internal/p9/server.go +++ b/internal/p9/server.go @@ -356,12 +356,15 @@ func (s *Server) write(cs *connState, fc *plan9.Fcall) *plan9.Fcall { if sess == nil { return errFcall(fc, "session not found") } + fmt.Fprintf(os.Stderr, "[DEBUG] /in write: session=%s input=%q state=%s\n", parts[1], input, sess.State()) // Use async send to avoid blocking on response if tmuxSess, ok := sess.(*tmux.Session); ok { ctx := context.Background() if err := tmuxSess.SendAsync(ctx, input); err != nil { + fmt.Fprintf(os.Stderr, "[DEBUG] /in write: SendAsync failed: %v\n", err) return errFcall(fc, err.Error()) } + fmt.Fprintf(os.Stderr, "[DEBUG] /in write: SendAsync succeeded\n") } else { return errFcall(fc, "async send not supported for this backend") }