3 ms·
That's cool! I was thinking of doing something similar a few weeks ago. I settled on using tools I knew well to just achieve what I needed quickly. I use tmux a
by kovek 10y ago
That's cool! I was thinking of doing something similar a few weeks ago. I settled on using tools I knew well to just achieve what I needed quickly. I use tmux and emacs. I run a tmux session with a window which has a top and bottom pane. Top pane shows a shell, and bottom pane shows emacs. Thanks to tmux, I can send keystrokes to a different pane. With emacs, I tell tmux to send the current line of characters to the top pane. In the emacs session, I have open a help.org file, where I organize some commands. For some reason, this worked with tmux 2.1 but not with tmux 2.3:
(defun send-command-to-cli () (interactive)
(let ((current 0)
(the-command "")
(start 0)
(end 0))
(setq current (point))
(org-beginning-of-line)
(setq start (point))
(org-end-of-line)
(setq end (point))
(goto-char current)
(setq the-command (concat
"tmux send-keys -t top ' "
(buffer-substring start end)
" ' ; tmux send-keys -t top C-a ; tmux send-keys -t top '#'; tmux select-pane -t top; " ))
(message the-command)
(shell-command the-command)
))