Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SSH_TTY is wrong with Tramp #35

Open
whhone opened this issue Dec 6, 2024 · 0 comments
Open

[BUG] SSH_TTY is wrong with Tramp #35

whhone opened this issue Dec 6, 2024 · 0 comments
Assignees

Comments

@whhone
Copy link

whhone commented Dec 6, 2024

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. Over SSH, inside a tmux session, open Emacs
  2. Open a buffer with Tramp e.g. (find-file "/sudo:root@localhost:/tmp/testing.txt")
  3. Copy some text from the Tramp buffer
  4. No text is copied to the system clipboard.

Expected behavior
The text is copied to the system clipboard.

** System Info (please complete the following information):**

  • OS: Linux
  • Emacs Version: 29
  • Any terminal multiplexers in play: Tmux
  • Local or remote (over SSH): Remote over SSH

Analysis
While under tramp, tmux show-environment is executed as a different user.

I can fix it by setting the default-directory to a non-tramp one to get it works.

Here is my fix:

(defun my/with-default-directory-local (orig-fun &rest args)
  (let ((default-directory user-emacs-directory))
    (apply orig-fun args)))

(advice-add 'clipetty--get-tmux-ssh-tty :around #'my/with-default-directory-local)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants