[erlang-questions] how can I run emacs from erlang

Anton Nikishaev me@REDACTED
Sat Jul 20 01:16:29 CEST 2013


"Richard A. O'Keefe" <ok@REDACTED> writes:

> I have a little C program called ttyname, whose source code is
> 	#include <stdio.h>
> 	#include <unistd.h>
>
> 	int main(void) {
> 	    char *s = ttyname(0);
> 	    return s == 0 || puts(s) == EOF;
> 	}

/usr/bin/tty


>> os:cmd("emacs").
> answers
> "emacs: standard input is not a tty\n".
>
>> os:cmd("emacs -nw </dev/tty >/dev/tty").
> answers
> "/bin/sh: line 1: /dev/tty: Device not configured\n"
>
> So what I sometimes do is
>
> % export TTYNAME=`ttyname`
> % erl
> ...
>> TTY = os:getenv("TTYNAME").
> ...
>> os:cmd("emacs -nw <" ++ TTY ++ " >" ++ TTY).
>
> and that works fine.

emacs -t DEVICE


-- 
lelf




More information about the erlang-questions mailing list