Controlling emacs -nw from another terminal or somehow remotely? or vi/pico
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Controlling emacs -nw from another terminal or somehow remotely? or vi/pico
Hi,
I would like to control emacs/editors externally ie send a
Ctrl-X Ctrl-F filename to switch files.
I've tried to 'echo -e Ctrl sequence Ctrl X Ctrl F > /dev/pts/X
without success.
I'm interested in making a minimal develop enviroment (just the features I need) after getting annoyed by the bloat of eclipse and esp. NetBeans (which I do really like).
I need to be able to control emacs/vi/pico remotely.
Using redirection is a (slow) win all situation, but if you know how
to do this alternatively for (preferably) emacs please let me know.
Thanks.
NB Netbeans/Eclipse general Java stuff would be great after DSL got hold
of them!
Hence I could get an external program like a file manager to switch
which file I am editing in emacs.
My original idea was to get the /dev/pts/X of the terminal running
emacs -nw from tty, and then
execute
echo -e some escape/control string > /dev/pts/X
on a different terminal.
This does work in some form-> I can send plain text strings which
then appear in emacs, but I can do special keys, and don't know why/how.
You could use emacsclient: with the --no-wait (or -n) option will cause emacs to open the file given on the command line. With the --eval option you can run arbitrary elisp code which is more flexible than sending keystrokes.
Thanks for the reply,
took me a while to understand lisp syntax but got it to work.
Using this I can do what I want using xemacs, so I can get started.
Also if I have more than 2 xemacs windows open, can I use gnuclient
with both?
I'm using gnuclient -batch -f function
control lines.
Also very tempted to try using lisp to program, is this a good idea?
I will be linking a filename, interface to svn,cvs, and other progs. I
going to use python.
Is the /dev/pts/ redirection impossible? If I can do it then any
editor would be able to be used. Will use the emacs client though, as
it exists.
still can't get C-x C-f working, could this be my choice of terminal?
I can send text via > dev/pts/X but not Ctrl-sequences.
Well, I didn't actually test my idea, just thought I would throw it out. It doesn't work for me either However, I noticed that echoing text doesn't exactly work, the text shows up on screen, but Emacs treats it as if it wasn't there (running on /dev/tty2 have the same behaviour). I guess echoing to the pts doesn't do exactly the same thing as the user typing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.