Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
93debbd1
Commit
93debbd1
authored
20 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Alt-S scancode actives backscroll (if available)
Copy current screen to end of scrollback. Reactive scrollback feature.
parent
dad57367
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/syncterm/menu.c
+24
-11
24 additions, 11 deletions
src/syncterm/menu.c
src/syncterm/term.c
+3
-5
3 additions, 5 deletions
src/syncterm/term.c
src/syncterm/term.h
+1
-0
1 addition, 0 deletions
src/syncterm/term.h
with
28 additions
and
16 deletions
src/syncterm/menu.c
+
24
−
11
View file @
93debbd1
...
...
@@ -2,30 +2,35 @@
#include
<ciolib.h>
#include
<keys.h>
#include
"cterm.h"
#include
"term.h"
#include
"uifcinit.h"
void
viewscroll
(
void
)
{
#if 0
int
top
;
int
key
;
int
i
;
char *
buf
;
char
*
scrollback
;
struct
text_info
txtinfo
;
int
x
,
y
;
x
=
wherex
();
y
=
wherey
();
uifcbail
();
gettextinfo
(
&
txtinfo
);
buf=(char *)malloc(txtinfo.screenheight*txtinfo.screenwidth*2);
gettext(1,1,txtinfo.screenwidth,txtinfo.screenheight,buf);
scrollback
=
(
char
*
)
malloc
((
term
.
width
*
2
*
backlines
)
+
(
txtinfo
.
screenheight
*
txtinfo
.
screenwidth
*
2
));
memcpy
(
scrollback
,
cterm
.
scrollback
,
term
.
width
*
2
*
backlines
);
gettext
(
1
,
1
,
txtinfo
.
screenwidth
,
txtinfo
.
screenheight
,
scrollback
+
(
cterm
.
backpos
)
*
cterm
.
width
*
2
);
drawwin
();
top=term.backpos-term.height;
top
=
cterm
.
backpos
;
gotoxy
(
1
,
1
);
for
(
i
=
0
;
!
i
;)
{
if
(
top
<
1
)
top
=
1
;
if(top>term.backpos
-term.height
)
top=term.backpos
-term.height
;
puttext(term.x
+
1,term.y
+
1,term.x+term.width,term.y+term.height
,term.
scrollback+(term.width*2*top));
if
(
top
>
c
term
.
backpos
)
top
=
c
term
.
backpos
;
puttext
(
term
.
x
-
1
,
term
.
y
-
1
,
term
.
x
+
term
.
width
-
2
,
term
.
y
+
term
.
height
-
2
,
scrollback
+
(
term
.
width
*
2
*
top
));
key
=
getch
();
switch
(
key
)
{
case
0
:
...
...
@@ -57,21 +62,29 @@ void viewscroll(void)
break
;
case
'j'
:
case
'J'
:
top
--
;
break
;
case
'k'
:
case
'K'
:
top
++
;
break
;
case
'h'
:
case
'H'
:
top
-=
term
.
height
;
break
;
case
'l'
:
case
'L'
:
top
+=
term
.
height
;
break
;
case
ESC
:
i
=
1
;
break
;
}
}
puttext(1,1,txtinfo.screenwidth,txtinfo.screenheight,buf);
free(buf);
puttext
(
1
,
1
,
txtinfo
.
screenwidth
,
txtinfo
.
screenheight
,
scrollback
+
(
cterm
.
backpos
)
*
cterm
.
width
*
2
);
free
(
scrollback
);
gotoxy
(
x
,
y
);
return
;
#endif
}
int
syncmenu
(
void
)
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/term.c
+
3
−
5
View file @
93debbd1
...
...
@@ -54,7 +54,8 @@ void doterm(void)
switch
(
key
)
{
case
0xff
:
case
0
:
switch
(
key
|
(
getch
()
<<
8
))
{
key
|=
getch
()
<<
8
;
switch
(
key
)
{
case
CIO_KEY_MOUSE
:
getmouse
(
&
mevent
);
break
;
...
...
@@ -92,12 +93,9 @@ void doterm(void)
case
CIO_KEY_F
(
4
):
rlogin_send
(
"
\033
Ox"
,
3
,
100
);
break
;
#ifdef __unix__
case
128
|
'S'
:
/* Under curses, ALT sets the high bit of the char */
case
128
|
's'
:
/* Under curses, ALT sets the high bit of the char */
case
0x1f00
:
/* ALT-S */
viewscroll
();
break
;
#endif
}
break
;
case
17
:
/* CTRL-Q */
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/term.h
+
1
−
0
View file @
93debbd1
...
...
@@ -9,6 +9,7 @@ struct terminal {
};
extern
struct
terminal
term
;
extern
int
backlines
;
void
doterm
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment