Jim Tcl
Check-in [7a9585aa6a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:aio: tty: allow setting echo

set-only e.g. to disable echo on stdin: stdin tty echo 0

This allows disabling echo while otherwise keeping cooked mode. Setting input to cooked or raw will overwrite this setting

Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk |
Files: files | file ages | folders
SHA1: 7a9585aa6a169ab1c3e80f80b3b49ad80101fbc5
User & Date: steveb@workware.net.au 2019-11-11 21:33:05
Context
2019-11-13
23:41
build: Fix out-of-tree build with json ext

If building out-of-tree, the jsmn/ directory may not exist. So create it during configure

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: d67f4d8890 user: steveb@workware.net.au tags: trunk,

2019-11-11
21:33
aio: tty: allow setting echo

set-only e.g. to disable echo on stdin: stdin tty echo 0

This allows disabling echo while otherwise keeping cooked mode. Setting input to cooked or raw will overwrite this setting

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 7a9585aa6a user: steveb@workware.net.au tags: trunk,

21:32
configure: add SIZEOF_INT to jim-config.h

It can be useful for extensions to know the size of integers

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 482d1fb2ce user: steveb@workware.net.au tags: trunk,

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to jim-aio.c.

1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
        0,
        0,
        /* Description: Relase a lock. */
    },
#endif
#if defined(HAVE_TERMIOS_H)
    {   "tty",
        "?baud rate? ?data bits? ?stop bits? ?parity even|odd|none? ?handshake xonxoff|rtscts|none? ?input raw|cooked? ?output raw|cooked? ?vmin n? ?vtime n?",
        aio_cmd_tty,
        0,
        -1,
        /* Description: Get or set tty settings - valid only on a tty */
    },
#endif
#endif /* JIM_BOOTSTRAP */







|







1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
        0,
        0,
        /* Description: Relase a lock. */
    },
#endif
#if defined(HAVE_TERMIOS_H)
    {   "tty",
        "?baud rate? ?data bits? ?stop bits? ?parity even|odd|none? ?handshake xonxoff|rtscts|none? ?input raw|cooked? ?output raw|cooked? ?echo 0|1? ?vmin n? ?vtime n?",
        aio_cmd_tty,
        0,
        -1,
        /* Description: Get or set tty settings - valid only on a tty */
    },
#endif
#endif /* JIM_BOOTSTRAP */

Changes to jim-tty.c.

75
76
77
78
79
80
81

82
83
84
85
86
87
88
89
90
91
92
93
94

95
96
97
98
99
100
101
...
314
315
316
317
318
319
320












321
322
323
324
325
326
327
328
329
    "handshake",
    "input",
    "output",
    "parity",
    "stop",
    "vmin",
    "vtime",

    NULL
};

enum {
    OPT_BAUD,
    OPT_DATA,
    OPT_HANDSHAKE,
    OPT_INPUT,
    OPT_OUTPUT,
    OPT_PARITY,
    OPT_STOP,
    OPT_VMIN,
    OPT_VTIME

};


#define ARRAYSIZE(A) (sizeof(A)/sizeof(*(A)))

/**
 * Search the flag/name map for an entry with the given name.
................................................................................
                    tio.c_iflag |= ICRNL;
                }
                else {
                    tio.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL | ICANON | IEXTEN | ISIG | NOFLSH | TOSTOP);
                    tio.c_iflag &= ~ICRNL;
                }
                break;













        }
    }

    if (tcsetattr(fd, TCSAFLUSH, &tio) < 0) {
        return -1;
    }
    return 0;
}







>












|
>







 







>
>
>
>
>
>
>
>
>
>
>
>









75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
    "handshake",
    "input",
    "output",
    "parity",
    "stop",
    "vmin",
    "vtime",
    "echo",
    NULL
};

enum {
    OPT_BAUD,
    OPT_DATA,
    OPT_HANDSHAKE,
    OPT_INPUT,
    OPT_OUTPUT,
    OPT_PARITY,
    OPT_STOP,
    OPT_VMIN,
    OPT_VTIME,
    OPT_ECHO
};


#define ARRAYSIZE(A) (sizeof(A)/sizeof(*(A)))

/**
 * Search the flag/name map for an entry with the given name.
................................................................................
                    tio.c_iflag |= ICRNL;
                }
                else {
                    tio.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL | ICANON | IEXTEN | ISIG | NOFLSH | TOSTOP);
                    tio.c_iflag &= ~ICRNL;
                }
                break;

            case OPT_ECHO:
                if (Jim_GetLong(interp, valueObj, &l) != JIM_OK) {
                    goto badvalue;
                }
                if (l) {
                    tio.c_lflag |= ECHO;
                }
                else {
                    tio.c_lflag &= ~ECHO;
                }
                break;

        }
    }

    if (tcsetattr(fd, TCSAFLUSH, &tio) < 0) {
        return -1;
    }
    return 0;
}

Changes to jim_tcl.txt.

56
57
58
59
60
61
62

63
64
65
66
67
68
69
....
4851
4852
4853
4854
4855
4856
4857




4858
4859
4860
4861
4862
4863
4864
~~~~~~~~~~~~~~~~~~
1. Add `file mtimeus` for high resolution file timestamps
2. `aio` now supports datagram Unix-Domain sockets
3. Add support for `aio lock -wait`
4. Add `signal block` to prevent delivery of signals
5. Add support for `file split`
6. Add support for `json::encode` and `json::decode`


Changes between 0.77 and 0.78
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Add serial/tty support with `aio tty`
2. Add support for 'jimsh -'
3. Add hidden '-commands' option to many commands
4. Add scriptable autocompletion support in interactive mode with `tcl::autocomplete`
................................................................................
    +*input raw|cooked*+;;
        Input character processing. In raw mode, the usual key sequences such as ^C do
        not generate signals.

    +*output raw|cooked*+;;
        Output character processing. Typically CR -> CRNL is disabled in raw mode.





    +*vmin* 'numchars'+;;
        Minimum number of characters to read.

    +*vtime* 'time'+;;
        Timeout for noncanonical read (units of 0.1 seconds)

+$handle *ssl* ?*-server* 'cert priv'?+::







>







 







>
>
>
>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
....
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
~~~~~~~~~~~~~~~~~~
1. Add `file mtimeus` for high resolution file timestamps
2. `aio` now supports datagram Unix-Domain sockets
3. Add support for `aio lock -wait`
4. Add `signal block` to prevent delivery of signals
5. Add support for `file split`
6. Add support for `json::encode` and `json::decode`
7. `aio tty` now allows setting +echo+ without full +raw+ mode

Changes between 0.77 and 0.78
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Add serial/tty support with `aio tty`
2. Add support for 'jimsh -'
3. Add hidden '-commands' option to many commands
4. Add scriptable autocompletion support in interactive mode with `tcl::autocomplete`
................................................................................
    +*input raw|cooked*+;;
        Input character processing. In raw mode, the usual key sequences such as ^C do
        not generate signals.

    +*output raw|cooked*+;;
        Output character processing. Typically CR -> CRNL is disabled in raw mode.

    +*echo 0|1*+;;
        Disable or enable echo on input. Note that this is a set-only value.
        Setting +input+ to +raw+ or +cooked+ will overwrite this setting.

    +*vmin* 'numchars'+;;
        Minimum number of characters to read.

    +*vtime* 'time'+;;
        Timeout for noncanonical read (units of 0.1 seconds)

+$handle *ssl* ?*-server* 'cert priv'?+::