Commit Graph

180 Commits

Author SHA1 Message Date
Anthony Minessale bc3e1c9e7d FS-11225: [freeswitch-core] Crash in fs_cli #resolve 2018-07-24 07:21:56 +00:00
Trever L. Adams 052c7c3061 FS-9785: Fix format-truncation warnings for systems that treat it as an error. 2017-06-29 21:35:38 -06:00
Michael Jerris 7f5af042be FS-8814: fix build on older libedit 2016-02-09 12:38:40 -06:00
Ken Rice 1b28dadc16 FS-8808 #resolve fixed ^D in fs_cli with editline to delete char under cursor, not just backspace 2016-02-08 12:42:41 -06:00
Anthony Minessale c4cea0cf44 FS-8787 #resolve [fs_cli prompt modifications] 2016-01-27 12:01:14 -06:00
Anthony Minessale d961aad2c2 FS-7604 #resolve 2015-06-02 13:17:04 -05:00
Michael Jerris 85a5e1db1d FS-7294: Enable -Werror when building with clang compiler 2015-02-17 16:23:53 -05:00
Mike Jerris 4c89075f2d Merge pull request #147 in FS/freeswitch from ~DDRAGIC/freeswitch:feature/FS-7128-fs_cli-ignore-duplicate-lines to master
* commit '2406abdb76a2c6dfb3da364a3997fb6d422e759d':
  FS-7128 fs_cli: ignore duplicate lines in history
2015-01-09 11:52:54 -06:00
Dušan Dragić 959b07c06f FS-7129 fs_cli: add toggle mode to function keys 2015-01-04 00:29:38 +01:00
Dušan Dragić 2406abdb76 FS-7128 fs_cli: ignore duplicate lines in history 2015-01-03 23:46:19 +01:00
Michael Jerris acd8d74316 cleanup conditions 2014-10-03 12:48:43 -04:00
Travis Cross 051772e4ae Add fs_cli option to disable use of history file
With this commit, passing -Q to fs_cli will cause fs_cli to not load
or save the command history file (~/.fs_cli_history).  This can be
useful e.g. on read-only systems.

This can also be set in the fs_cli configuration file with the option
`no-history-file`.
2014-09-25 11:07:49 +00:00
Travis Cross 323a3d617c Avoid output of junk text by fs_cli
In some cases where `redisplay()` is called immediately after a
command is run (e.g. `log ...`) we often get a prompt, junk output,
and a second prompt.  This is due to a (known) race.

We believe we're falling afoul of this code in `el_deletestr`:

    if (el->el_line.cursor < &el->el_line.buffer[n])
            return;

Basing the length of text to delete off of the cursor position
resolves the issue of junk text, but the real solution is to eliminate
the race conditions, which will also resolve the sometimes duplicated
prompt.

FS-6764 #resolve

Thanks-to: Nathan Neulinger <nneul@neulinger.org>
2014-08-26 20:18:22 +00:00
Chris Rienzo 9b14633cf3 fs_cli: fix compiler error on CentOS 6 caused by recent short uuid logging change 2014-06-30 17:30:59 -04:00
Travis Cross 31186d815b Improve a parameter name for fs_cli
What we momentarily called log-uuid-chars is now better called
log-uuid-length.  Setting log-uuid-length will specify a truncation
length for UUIDs displayed by setting log-uuid.
2014-06-04 16:07:10 +00:00
Travis Cross c015013e5f Add log-uuid-short option to fs_cli
If log-uuid-short is set, or -S is passed to fs_cli, we only display
the first 8 hex digits of the UUID.  The log-uuid-chars option may
instead be set to specify some other truncation length for the UUID.
2014-06-04 12:01:01 +00:00
William King 7ce2009fad Fix compiler warning about possibly uninitialized variable in libs/esl 2014-06-02 08:33:05 -07:00
Michael Jerris e992c4c4d8 CID:1216560 Unchecked return value from ioctl 2014-06-02 14:11:07 +00:00
Travis Cross 180d081be4 Use buffered printers in fs_cli
Now that all output should end in a newline, we don't need to play
tricks with getting certain escape codes out ahead of buffered output.

This updates what we tried to do in commit
991b83d23c.

This partially reverts commit
8056125077.
2014-03-28 00:01:33 +00:00
Travis Cross 11f4628cae Reenable the new EL_REFRESH mechanism 2014-03-27 23:09:06 +00:00
Travis Cross 59f80c9e4f Handle bodies not ending in newlines w/EL_REFRESH
The issue is that sofia siptrace output doesn't end each line with a
newline.  Instead it sends a separate newline afterward, which comes
in as a separate event body.  With the new EL_REFRESH code in effect
the line is being cleared after the siptrace output has been written
but before that next newline comes in.

With our own refresh code this doesn't happen because of slight
differences in where the stdio buffers get flushed compared to where
the output of clear_line() ends up.

This is a bit of a clumsy workaround.  But we'll fix it first, then
refactor.
2014-03-27 23:06:07 +00:00
Travis Cross 3bc51dfff9 Turn on the fancy fs_cli with a modern libedit
We turn ON the features with a newer libedit.

This fixes commit 4f54f912c3.
2014-03-27 17:35:35 +00:00
Travis Cross 4f54f912c3 Add back terminal detection for old libedits
Using the system libedit means that libedit will again make absolute
movements on certain kinds of terminals.  Older versions of libedit
without EL_PROMPT_ESC miscalculate the length of the prompt.
Combined, this results in the cursor ending up in the wrong place.

We knew this was a possibility when we moved to system libedit, and
we're OK with it.  We certainly lived without this fancy prompt
feature for a long time.

This change puts back in place detection of the terminal type when
EL_PROMPT_ESC isn't available.  On these older versions of libedit,
we'll only enable the fancy features when we know that libedit will
only make relative movements and not tickle the bug.

This partially reverts commit:
b9b77bd615
2014-03-27 17:19:55 +00:00
Travis Cross dc093d179e Drop use of libedit EL_REFRESH in fs_cli for now
Newer versions of libedit provide an EL_REFRESH mechanism for
redrawing the prompt.  We had previously written our own code to
handle this.  In theory handing this over to libedit should be better.

Unfortunately when using EL_REFRESH the output of sofia siptrace isn't
showing up.  We're working on that, but for now we're just force own
our redrawing code to be used instead.
2014-03-27 12:20:43 +00:00
Brian West c7bd862e9a FS:353: correct #if check for libedit function capability 2014-03-24 16:18:03 -05:00
James Le Cuirot 8574988c3a Completely unbundle libedit
FS-353

Signed-off-by: Travis Cross <tc@traviscross.com>
2014-03-24 12:39:59 +00:00
Travis Cross cdc358c505 Add comment to distant #endif
FS-353
2014-02-23 22:33:28 +00:00
James Le Cuirot d996974faa Fix building without libedit
Signed-off-by: Travis Cross <tc@traviscross.com>

FS-353
2014-02-23 22:33:20 +00:00
Anthony Minessale b5821c1594 tweak event queue size on event socket and speed up fs_cli a little to keep up on busy logging env 2014-01-23 21:26:56 +05:00
Anthony Minessale 3ff0aaa0be FS-5653 --resolve 2014-01-07 00:38:48 +05:00
Anthony Minessale 2e74cf79fc FS-5617 --resolve 2013-07-19 13:29:05 -05:00
Jeff Lenk 5fc2bc9993 FS-5588 --resolve windows compiler fixes 2013-07-09 07:53:56 -05:00
Ken Rice 22baa51acc FS-2816 --resolve 2013-07-06 22:04:06 -05:00
Nathan Neulinger 32adc789f6 make noexpandtab explicit in all vim modelines other than xml files 2013-06-25 11:50:17 -05:00
Travis Cross a5397e5980 Remove assignment without effect in fs_cli 2013-05-27 21:07:56 +00:00
Travis Cross f00b77597f Avoid dangling reference at end of fs_cli
Not that it really matters since we're returning to the OS momentarily
at that point anyway.
2013-05-27 21:07:52 +00:00
Anthony Minessale 5ee719d1d9 FS-5271 --resolve 2013-04-08 12:53:58 -05:00
Anthony Minessale bd25514307 add FS_CLI_COLOR=false env and -n/--no-color command line flag to turn off colored banner 2013-02-20 13:51:53 -06:00
Ken Rice 9c975033a7 FS-4844 --resolve 2013-02-07 13:16:19 -06:00
Jeff Lenk 77eabbbdf7 FS-4694 --resolve 2012-10-17 09:17:16 -05:00
Anthony Minessale c51aebf621 FS-4694 --resolve 2012-10-16 19:03:29 -04:00
Stefan Knoblich 8075b01569 Fix error in switch_core_screen_size() and screen_size() fallback code.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-09-26 17:21:05 +02:00
Michael Jerris ee50ed23ab FS-4645: --resolve fix build error in fs_cli 2012-09-25 14:19:00 -04:00
Anthony Minessale 03c981bf72 add smaller banner for teeny tiny terminals 2012-09-24 14:59:09 -05:00
Michael Jerris 4ff9b2f102 revert fb2ffbafe2 2012-09-24 15:38:06 -04:00
Travis Cross fb2ffbafe2 Add configure flags to moderate the ClueCon nags
The default remains the same: we show the huge ClueCon nag banner on
startup and in fs_cli.

However, if you pass --disable-huge-cluecon-nag, no banner will be
shown.

If you pass --enable-modest-cluecon-nag, a modest text-based ClueCon
reminder will be shown instead.
2012-09-23 07:49:26 +00:00
Jeff Lenk e4e044e310 FS-4566 --resolve Show fs_cli banner in color(windows) 2012-09-02 21:57:20 -05:00
Jeff Lenk 0807b39c8d FS-4543 --resolve thanks Peter 2012-08-17 19:31:47 -05:00
Anthony Minessale f454b79b9b fix color coding to be OS appropriate 2012-08-16 13:04:33 -05:00
Anthony Minessale 27155bcb71 come to ClueCon its in one month 2012-07-10 12:05:26 -05:00