Hacker News new | past | comments | ask | show | jobs | submit login

Here is the page about Tmux from the public portion of my knowledge graph:

https://github.com/JeffreyBenjaminBrown/notes-in-org-format-...

See in particular the passage "send text to a tmux session|window|pane".

In Emacs, `M-x desktop-save` and `M-x desktop-change-dir` will let you save your session state and restore from a saved state. Also handy is the command `process-send-string`. I use it in the below (from my .emacs config[1]) to mark one buffer as the "receiving GHCI buffer" and then send text from another buffer to be evaluated in that one.

    ;; https://emacs.stackexchange.com/a/37889
    (defun mark-receiving-ghci-buffer ()
       (interactive)
       (setq receiving-ghci-buffer (buffer-name)))
    (defun send-highlighted-region-to-receiving-ghci-buffer (beg end)
      (interactive "r")
      (process-send-string receiving-ghci-buffer ":{\n")
      (process-send-region receiving-ghci-buffer beg end)
      (process-send-string receiving-ghci-buffer "\n:}\n"))
    (global-set-key ( kbd "C-c s")
      ( lambda () (interactive)
        (send-highlighted-region-to-receiving-ghci-buffer) ) )
[1] https://github.com/JeffreyBenjaminBrown/play/blob/master/dot...



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: