summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Love <blove+gnu@kylimar.com>2012-03-14 14:01:43 -0400
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2012-03-14 14:01:43 -0400
commitdb59704c1297c056cec0cc9305ae92e44a15bf33 (patch)
tree23461ed6c792d9b5a1adf874c65822fe85df9b85
parent3c2946ed7b773370924e34b07e78015c87a3e325 (diff)
downloadscreen-db59704c1297c056cec0cc9305ae92e44a15bf33.tar.gz
Add a new escape character 'E' to indicate whether the escape character has been pressed.
This can be used to show visual notification in the hardstatus/caption that the user has pressed the escape character.
-rw-r--r--src/ChangeLog2
-rw-r--r--src/doc/screen.12
-rw-r--r--src/doc/screen.texinfo2
-rw-r--r--src/process.c30
-rw-r--r--src/screen.c5
5 files changed, 36 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1b29f87..d3936ff 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -53,6 +53,8 @@ Version 4.1.0 (??/??/20??):
'%+p' expands to the PID of the frontend (display).
* '%S' in caption/hardstatus string expands to the session name.
* '%P' in the caption string evaluates to true if the region is in copy mode.
+ * '%E' in the caption string evaluates to true if the escape character has
+ currently been pressed.
Window List:
* Nested views when there are window groups (with 'windowlist -g').
diff --git a/src/doc/screen.1 b/src/doc/screen.1
index c175891..bbb5a3d 100644
--- a/src/doc/screen.1
+++ b/src/doc/screen.1
@@ -3692,6 +3692,8 @@ current time HH:MM in 12h format
day number
.IP D
weekday name
+.IP E
+sets %? to true if the escape character has been pressed.
.IP f
flags of the window, see \*Qwindows\*U for meanings of the various flags
.IP F
diff --git a/src/doc/screen.texinfo b/src/doc/screen.texinfo
index 08ca259..e39003a 100644
--- a/src/doc/screen.texinfo
+++ b/src/doc/screen.texinfo
@@ -5438,6 +5438,8 @@ current time @code{HH:MM} in 12h format
day number
@item D
weekday name
+@item E
+sets %? to true if the escape character has been pressed.
@item f
flags of the window. @xref{Windows}, for meanings of the various flags.
@item F
diff --git a/src/process.c b/src/process.c
index 70e59f3..d86c62c 100644
--- a/src/process.c
+++ b/src/process.c
@@ -908,12 +908,19 @@ int ilen;
if (slen)
DoProcess(fore, &ibuf, &slen, 0);
if (--ilen == 0)
- D_ESCseen = ktab;
+ {
+ D_ESCseen = ktab;
+ WindowChanged(fore, 'E');
+ }
}
if (ilen <= 0)
return;
ktabp = D_ESCseen ? D_ESCseen : ktab;
- D_ESCseen = 0;
+ if (D_ESCseen)
+ {
+ D_ESCseen = 0;
+ WindowChanged(fore, 'E');
+ }
ch = (unsigned char)*s;
/*
@@ -1863,10 +1870,18 @@ int key;
}
if (D_ESCseen != ktab || ktabp != ktab)
{
- D_ESCseen = ktabp;
+ if (D_ESCseen != ktabp)
+ {
+ D_ESCseen = ktabp;
+ WindowChanged(fore, 'E');
+ }
break;
}
- D_ESCseen = 0;
+ if (D_ESCseen)
+ {
+ D_ESCseen = 0;
+ WindowChanged(fore, 'E');
+ }
}
/* FALLTHROUGH */
case RC_OTHER:
@@ -6470,6 +6485,7 @@ int i;
if (act->nr != RC_ILLEGAL)
{
D_ESCseen = 0;
+ WindowChanged(fore, 'E');
DoAction(act, i + 256);
return 0;
}
@@ -6495,7 +6511,11 @@ int i;
if (discard && (!act || act->nr != RC_COMMAND))
{
- D_ESCseen = 0;
+ if (D_ESCseen)
+ {
+ D_ESCseen = 0;
+ WindowChanged(fore, 'E');
+ }
return 0;
}
D_mapdefault = 0;
diff --git a/src/screen.c b/src/screen.c
index b3c85d4..949df01 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2855,6 +2855,11 @@ int rec;
}
#endif
break;
+ case 'E':
+ p--;
+ if (display && D_ESCseen)
+ qmflag = 1;
+ break;
case '>':
truncpos = p - winmsg_buf;
truncper = num > 100 ? 100 : num;