Skip to content

Commit

Permalink
fuel.listener: new vocab with a listener better for FUEL (factor#1486)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjourne committed Oct 6, 2015
1 parent 8762d1c commit 27a7079
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
13 changes: 13 additions & 0 deletions extra/fuel/listener/linux/linux.factor
@@ -0,0 +1,13 @@
USING: accessors fuel.listener io.serial.linux io.serial.linux.ffi
kernel libc math.bitwise sequences system ;
IN: fuel.listener.linux

: flush-termios ( termios fileno -- )
TCSAFLUSH rot tcsetattr io-error ;

: set-raw-flags ( termios -- )
[ ICANON unmask ECHO unmask ] change-lflag
cc>> [ 1 VMIN rot set-nth ] [ 0 VTIME rot set-nth ] bi ;

M: linux fuel-pty-setup
0 get-fd-termios dup set-raw-flags 0 flush-termios ;
1 change: 1 addition & 0 deletions extra/fuel/listener/linux/platforms.txt
@@ -0,0 +1 @@
linux
6 changes: 6 additions & 0 deletions extra/fuel/listener/listener-docs.factor
@@ -0,0 +1,6 @@
USING: help.syntax ;
IN: fuel.listener

ARTICLE: "fuel.listener" "FUEL command listener" "This vocab contains the listener started from FUEL. It sets up the pty in non-canonical mode so that you can paste long lines into it from Emacs." ;

ABOUT: "fuel.listener"
13 changes: 13 additions & 0 deletions extra/fuel/listener/listener.factor
@@ -0,0 +1,13 @@
USING: kernel listener system vocabs ;
IN: fuel.listener

HOOK: fuel-pty-setup os ( -- )

M: object fuel-pty-setup ;

os linux? [ "fuel.listener.linux" require ] when

: fuel-listener ( -- )
fuel-pty-setup listener-main ;

MAIN: fuel-listener
2 changes: 1 addition & 1 deletion misc/fuel/fuel-listener.el
Expand Up @@ -137,7 +137,7 @@ sessions."
(message "Starting FUEL listener (this may take a while) ...")
(pop-to-buffer (fuel-listener--buffer))
(make-comint-in-buffer "fuel listener" (current-buffer) factor nil
"-run=listener" (format "-i=%s" image))
"-run=fuel.listener" (format "-i=%s" image))
(fuel-listener--wait-for-prompt 60000)
(fuel-listener--history-setup)
(fuel-con--setup-connection (current-buffer))))
Expand Down

0 comments on commit 27a7079

Please sign in to comment.