Skip to content

Commit 82917ec

Browse files
committed
prepare for 5.5.6
1 parent fb6db56 commit 82917ec

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

pspg.spec

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Summary: pspg: a unix pager optimized for psql
55
Name: pspg
6-
Version: 5.5.5
6+
Version: 5.5.6
77
Release: 0%{?dist}
88
License: BSD
99
Group: Development/Tools
@@ -43,7 +43,10 @@ CFLAGS="$RPM_OPT_FLAGS"
4343
%{_bindir}/*
4444

4545
%changelog
46-
* Tue Nov 2 2021 Pavel Stehule <[email protected]>
46+
* Tue Aug 2 2022 Pavel Stehule <[email protected]>
47+
- allow to set esc delay interval
48+
49+
* Tue Nov 2 2021 Pavel Stehule <[email protected]>
4750
- new visual effects --highlight-odd-rec and --hide-header-line
4851
- possibility to read SQLcl (Oracle) tables in ANSICONSOLE format
4952
- support streaming mode over files on BSD like systems (kqueue support)

src/commands.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ translate_event(int c, bool alt, Options *opts, int *nested_command)
409409
return cmd_ForwardSearch;
410410
case '9':
411411
return cmd_ShowMenu;
412-
case 27:
412+
case PSPG_ESC_CODE:
413413
return cmd_Escape;
414414
case '0':
415415
return cmd_Quit;

src/inputs.c

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#include "inputs.h"
3636
#include "pspg.h"
3737

38+
#define PSPG_NOTASSIGNED_CODE 0
39+
3840
static char pathname[MAXPATHLEN] = "";
3941

4042
FILE *f_tty = NULL; /* ncurses input stream */

src/pspg.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ show_info_wait(const char *fmt,
15961596

15971597
/* eat escape if pressed here */
15981598
if (event == PSPG_NCURSES_EVENT &&
1599-
!(nced.keycode == 27 && nced.alt))
1599+
!(nced.keycode == PSPG_ESC_CODE && nced.alt))
16001600
unget_pspg_event(&nced);
16011601
}
16021602

src/pspg.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define FILE_TSV 2
3636
#define FILE_MATRIX 3
3737

38-
#define PSPG_VERSION "5.5.5"
38+
#define PSPG_VERSION "5.5.6"
3939

4040
/* GNU Hurd does not define MAXPATHLEN */
4141
#ifndef MAXPATHLEN
@@ -473,7 +473,6 @@ extern bool get_string(char *prompt, char *buffer, int maxsize, char *defstr, ch
473473
* Global constants
474474
*/
475475
#define PSPG_ESC_CODE 27
476-
#define PSPG_NOTASSIGNED_CODE 0
477476

478477
/*
479478
* Global setting

src/readline.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ pspg_display_match(char **matches, int num_matches, int max_length)
492492
pos -= 1;
493493
else if (c == 2 || c == 9)
494494
pos += 1;
495-
else if (c == 4 || c == 27)
495+
else if (c == 4 || c == PSPG_ESC_CODE)
496496
break;
497497
else if (c == 5)
498498
{
@@ -662,7 +662,7 @@ get_string(char *prompt,
662662
while (c == ERR || c == 0);
663663

664664
/* detect double alts .. escape */
665-
if (c == 27 && prev_c == 27)
665+
if (c == PSPG_ESC_CODE && prev_c == PSPG_ESC_CODE)
666666
{
667667
/*
668668
* Cannot leave here - readline requires complete ALT pair.
@@ -702,7 +702,7 @@ get_string(char *prompt,
702702
char *ptr = readline_buffer;
703703

704704
while (*ptr)
705-
if (*ptr++ == 27)
705+
if (*ptr++ == PSPG_ESC_CODE)
706706
{
707707
result_is_ok = false;
708708
break;

0 commit comments

Comments
 (0)