aboutsummaryrefslogtreecommitdiff
path: root/jim-interactive.c
AgeCommit message (Collapse)AuthorFilesLines
2023-07-04interactive: enable hint supportSteve Bennett1-20/+104
And add a default implementation of tcl::stdhint to add hinting for some built-in commands. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-07-04aio: change to use unix io, not stdioSteve Bennett1-0/+1
This changes especially makes buffered I/O work with non-blocking channels. - separate read and write buffering - support for timeout on blocking read - read/write on same channel in event loop with buffering - read buffer is the same across read, gets, copyto - autoflush non-blocking writes via event loop - copyto can now copy to any filehandle-like command - add some copyto tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-03Convert some errant malloc/free to Jim_Alloc()/Jim_Free()Steve Bennett1-3/+3
Go through the Jim versions where it makes sense so we can add debugging or other features as required. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-05build: quieten compiler warningsSteve Bennett1-1/+3
Irrelevant warnings from some compilers Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-23history: Add support for history keepSteve Bennett1-0/+15
Fixes #191 Signed-off-by: Steve Bennett <steveb@workware.net.au> Reported-by: D. Bohdan <dbohdan@dbohdan.com>
2019-11-30jimsh: interactive mode: print nullsSteve Bennett1-1/+2
If the interp result contains embedded nulls, print the full result. Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2018-07-08remove some unused variable assignmentsSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2018-03-25linenoise: Update to support multiline mode.Steve Bennett1-0/+7
Updated to: https://github.com/msteveb/linenoise/commit/ad5172e99520e2fe2a35b4bbd7fbc74d9df36df1 Now supports multiline mode (by setting $history::multiline to 1) Improved windows support Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-15history: Add autocompletion supportSteve Bennett1-16/+54
With 'history completion <cmd>' Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-03-03Fix some declarations after codeSteve Bennett1-1/+2
For the benefit of C89 compilers. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-06Fix for systems without umaskSteve Bennett1-0/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-29jimsh: Scriptable command-line completion supportSteve Bennett1-0/+42
via tcl::autocomplete Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-07jim-intereactive: reduce permissions on saved history fileSteve Bennett1-0/+5
When creating ~/.jim_history, set permissions to 0600 for security Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-03-27Don't include unistd.h unless configure has found itEvan Hunter1-1/+3
2016-03-27jim: Jim_ScriptIsComplete() now takes an objectSteve Bennett1-5/+2
Rather than taking a string and a length, it is simpler and more efficient to take a Jim_Obj Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-03-27Small code cleanupsSteve Bennett1-9/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-21many comment changes, some small code changesSteve Bennett1-1/+1
Sweep through and clean up all (most) of the comments in the code. While there, adjust some variable and function names to be more consistent, and make a few small code changes - again, mostly for consistency. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-03Remove tabs from source filesSteve Bennett1-5/+5
Tabs accidentally crept into source files in violaton of the style guide Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-11-09Strip trailing newline from Jim_HistoryGetLine()Steve Bennett1-0/+5
When linenoise line editing is disabled Reported-by: Sergei Gavrikov <sergei.gavrikov@gmail.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-09Make interactive getline/history API publicSteve Bennett1-17/+51
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-24Create build-jim-ext for building extensionsSteve Bennett1-1/+2
Simplifies the process of building loadable extensions Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-18Don't load and save history if not on a ttySteve Bennett1-2/+5
If jimsh is run in interactive mode but without a tty, don't bother to load and save line editing history. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-01Add Jim_String() macroSteve Bennett1-1/+1
It is very common to get the string value without the length. Jim_String() is a macro which does that. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-04-25Remove out-of-date copyrightSteve Bennett1-2/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-21All Jim source should include jimautoconf.hSteve Bennett1-0/+1
This ensures that everything picks up the autoconf settings
2010-11-19Allow Jim_InteractivePrompt() to return [exit] to callerSteve Bennett1-2/+2
And update jimsh return code handling Reported-By: Patrick WEBER <patrick.weber@live.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-17Add command line editing with linenoiseSteve Bennett1-15/+75
Enabled by default, but can be disabled with --disable-lineedit Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-17Add UTF-8 support to JimSteve Bennett1-0/+3
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Portability fixesSteve Bennett1-1/+0
Especially for eCos, mingw32 and cygwin Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Remove dependence of jim core on stderrSteve Bennett1-9/+7
Remove Jim_PrintErrorMessage() and create Jim_MakeErrorMessage() instead. Move errorInfo to stdlib since it is now required. Also move lassign from tclcompat to stdlib as a core command. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reduce excessive stack usageSteve Bennett1-2/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up the indentation messSteve Bennett1-11/+13
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Allow catch to specify what is caughtSteve Bennett1-7/+6
*: Default to the same as Tcl. Not signal, eval, exit. *: Use 'catch -exit' to also catch exit. *: Also map for standard return codes: [info returncodes] *: Also Jim_ReturnCode() *: Add Jim_FindByName() for searching in a char* array *: Fix 'info nameofexectutable' if $::jim_argv0 is not set
2010-10-15Many improvements, bug fixesSteve Bennett1-1/+2
*: Allow math functions to be enabled via configure *: Allow support for references to be removed *: Documentation updates *: Jim_ListLength() now returns the result directly *: Optimise list -> dict conversion *: Consistent capitalisation of some structures, functions *: Add support for abbreviations to Jim_GetEnum() *: The commands to 'info' may be abbreviated *: Use abbreviation support in parsing options to 'subst' *: Use Jim_GetEnum() to parse return code names *: Optimise 'array get', 'array set' if no conversion needed *: Import Tcl string.test *: string compare now returns -1,0,1 like Tcl *: Fix 'string last' with index=0 *: Add support for 'string reverse' *: Add -nocase option to 'string equal' *: Fix infinite loop in 'string repeat str -1' *: Support braced patterns in glob *: glob should not return dot files unless the pattern starts with . *: Simplify glob.tcl by using some new features *: When creating C extensions from Tcl, preserve newlines and invoke with Jim_Eval_Named() to produce more meaningful error messages. *: Also remove all comments, not just those starting in the first column *: Add support for 'n+n' and 'n-n' in string/list indexes (Tcl 8.5) *: Add a level to the stack trace for 'return -code error' *: 'return -code' should also affect the return from 'source' (see Tcl docs) *: Fix lsort -command *: Some systems don't have INFINITY
2010-10-15Bug fixes, documentation updatesSteve Bennett1-0/+5
jimsh - retry on EINTR from fgets() Fix 0 -> NULL for 64 bit systems Fix overlapping memcpy Fix jim array dereferencing bug *: Counting of parentheses was incorrect with nested array references *: The result for array dereference wasn't being used properly Add os.uptime command Documentation: autogenerated command index Fix gets when last line has no newline
2010-10-15jimsh improvements plus documentationSteve Bennett1-1/+1
Add /lib/jim to the default auto_path *: Otherwise there is no 'standard' location to install packages Prompt should show name for all non-zero return types Initial documentation for Jim ------------------------------------------------------------------------
2010-10-15Implement some new featuresSteve Bennett1-2/+2
Implement 'lreplace' Implement 'string last' Implement 'pid' Implement 'info procs' Implement 'info script' Implement 'info patchlevel' as an alias for 'info version' Implement syslog extensions for jim Fix return code display in jim-interactive.c Make jim more compatible if JIM_TCL_COMPAT is set *: Use tcl_interactive rather than jim_interactive *: Use auto_path rather than jim_libpath Add "." to the lib search path, not "./" Fix a couple of files with CRLF line endings
2010-10-15Strip out unneeded junk from JimSteve Bennett1-0/+62
Nvp, getopt, move interactive processing to jim-interactive.c