forked from factor/factor
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fuel.listener: new vocab with a listener better for FUEL (factor#1486)
- Loading branch information
Showing
5 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters