Commit graph

48 commits

Author SHA1 Message Date
Ashish Kumar Yadav 226ee06772 Fixed selsnap
Only access history buffer when not on alternate screen
2021-08-12 23:13:06 +05:30
Ashish Kumar Yadav 3cfcac83b6 Implemented right-click-plumb 2021-08-12 03:48:38 +05:30
Ashish Kumar Yadav 30277db347 Fix twritetab
Selection clearing was not being performed.
2021-08-12 01:36:23 +05:30
Ashish Kumar Yadav 1ad3e5a6a5 Cleanup 47, 1047, 1048, 1049 CSI handling, Fix sel.alt
1) sel.alt used not to be respected in places where it should have been.

2) 1048 CSI handling turned off if not allowaltscreen following the
   behaviour of xterm.
2021-08-12 01:28:49 +05:30
Ashish Kumar Yadav a0fc34ef14 Small optimization 2021-08-11 21:49:41 +05:30
Ashish Kumar Yadav f282d3d586 Fixed bug introducted in second last commit 2021-08-11 21:45:42 +05:30
Ashish Kumar Yadav fb8f1aec08 Cleanup, bug fixes and optimizations; LAZY RESIZING
1) Update CURSOR_WRAPNEXT flag on resizing

2) Cleanup alternate screen handling, improving tnew (changed its name
   to more appropriate tinit) and treset.

3) Lazy resizing
   Separate alternate screen and default screen resizing. Only resize
   the visible screen. Apply size to the other screen when swapping
   screen.

4) Restore tcursor since the change is no longer required.

5) Improve and clean scrolling functions.

6) Handle 47, 1047, 1049 CSI sequences in the same way as xterm and vte
   do.
2021-08-11 20:15:04 +05:30
Ashish Kumar Yadav 8df80c351e Cleanup 2021-08-10 22:31:01 +05:30
Ashish Kumar Yadav f29d1b2138 externalpipe - setsid after fork 2021-08-10 15:36:53 +05:30
Ashish Kumar Yadav 4ba3980f7d Fixed BUGS in tiswrapped and treflow; cleanup
Wrongly assumed tlinelen() will always be greater than 0.
2021-08-10 00:51:05 +05:30
Ashish Kumar Yadav becfd212c7 IMPLEMENT TEXT-REFLOW; cleanup and bug fixes
0) Undid change in maxlatency, Added neomutt bar to worddelimiters.

1) selnormalize specifying tlinelen() to sel.nb.x wasn't a bug.
   If sel.nb.x is greater than tlinelen, tlinelen would be less than
   term.col - 1. (9708549676)

2) Fixed selsnap where snapping was only limited to the visible region.

3) Fixed externalpipe (close unnecessary fd's after fork).

4) tnew now doesn't call tresize and initializes things itself.

5) Fixed selection and clearing related bugs in tscrollup and simplified
   it a little.

6) Fixed selscroll (sel coordinates are always relative to term.scr,
   they used to be wrongly compared to absolute coordinates).

7) Fixed selected() function calls (input should be relative to
   term.scr).

8) IMPLEMENTED TEXT-REFLOW.

9) Simplified(?) tresize. (It could be further simplified by entirely
   removing rscrolldown() and current (col == term.col) handling of
   non-alt screen and always using treflow(). But I didn't do it
   thinking it would be costly performance wise for 30 odd extra lines
   of code.
2021-08-09 21:57:04 +05:30
Ashish Kumar Yadav d2cffdc9c9 Cleanup 2021-08-07 03:01:40 +05:30
Ashish Kumar Yadav 533d55cdcc Fixed bug in sigchld, styling fix 2021-08-07 02:34:30 +05:30
Ashish Kumar Yadav 9708549676 Implemented externalpipe, fixed bugs, cleanup
1) Implemented externalpipe

2) Fixed bug in selnormalize (sel.nb.x was being set over col-1)

3) Fixed bug in alacritty style clear screen

4) No need to use heap in tdumpline
2021-08-07 02:25:45 +05:30
Ashish Kumar Yadav b29caa7c2f Cleanup; fixed bug in selnormalize 2021-08-06 19:42:45 +05:30
Ashish Kumar Yadav 7d60be40d9 In delimiters, only snap spaces together 2021-08-06 19:06:42 +05:30
Ashish Kumar Yadav 3478dadfa0 Style fix 2021-08-06 18:52:13 +05:30
Ashish Kumar Yadav 92c5965daf Cleanup; implemented copying of tab characters 2021-08-06 18:10:43 +05:30
Ashish Kumar Yadav 8ab96078af Consistency 2021-08-05 15:26:50 +05:30
Ashish Kumar Yadav 20fa88e1ca tmoveto is overkill 2021-08-05 15:20:23 +05:30
Ashish Kumar Yadav 8d16d9ed5c Fixed bug in tresize; cleanup 2021-08-04 23:38:37 +05:30
Ashish Kumar Yadav ef32c7cd1a cleanup, fixed bugs and optimization - scrolling and selection 2021-08-04 22:29:41 +05:30
Ashish Kumar Yadav ce3641b011 Kill me 2021-08-04 20:20:54 +05:30
Ashish Kumar Yadav a5a6b60719 Consistency b/w up and down 2021-08-04 19:02:20 +05:30
Ashish Kumar Yadav a9fc3e7094 This way the lines are more readable 2021-08-04 18:49:23 +05:30
Ashish Kumar Yadav 531c8febed Fixed parsing of escape sequences 2021-08-04 18:09:47 +05:30
Ashish Kumar Yadav d82d245d83 Fixed race condition in sigchld
In the earlier setup, "pid" might exit just after first waitpid check in
sigchld and get reaped in the following waitpid loop without being
noticed.
2021-08-04 14:15:26 +05:30
Ashish Kumar Yadav 007da591c0 Optimized and improved newterm
1) chdir is quite costly, save pwd string instead

2) Configurable double-forking

3) Close file descriptors after fork

4) Additions to sigchld (shell is not the only possible child now)
   and switch to sigaction
2021-08-04 03:38:58 +05:30
Ashish Kumar Yadav 696c94cf9c Don't reset title on RIS by default (make it configurable) 2021-08-03 02:00:15 +05:30
Ashish Kumar Yadav 39d2aab1fd Fixed bug in tresize - save non-alt screen cursor 2021-08-02 13:25:59 +05:30
Ashish Kumar Yadav 1c95525637 Fixed bug in tresize scroll down; cleanup
Scroll down should be performed after tclearregion.
2021-08-02 13:19:42 +05:30
Ashish Kumar Yadav a8c4d3350e term.histf can be 0 2021-08-02 12:44:23 +05:30
Ashish Kumar Yadav 41a6d8a9dd Fixed bug - rscrolldown returns if n <= 0 2021-08-02 12:42:16 +05:30
Ashish Kumar Yadav 0d71b28dea term.scr should always be set to 0 when switching to alt screen
Doing it always when switching wouldn't hurt
2021-08-02 12:35:26 +05:30
Ashish Kumar Yadav 68e40c845c term.scr should also be set to 0 - treset 2021-08-02 12:26:09 +05:30
Ashish Kumar Yadav 6c8aa87abb Fixed bugs, cleanup, conventional behaviour on resize
1) Lowered the value of HISTSIZE to 2000.

2) Scroll down on increasing height (on resizing).

3) No need to alloc maxcols to alt screen.

4) term.c.y is taken from tcurbuf for inactive screen. But it can be holding
   a value from previous window dimensions if the terminal window was resized
   while the screen was inactive. Fixed this bug by limiting the value of
   term.c.y to term.row - 1.

5) Improved tresize function overall.
2021-08-02 12:08:11 +05:30
Ashish Kumar Yadav 42b2887995 Use defaultfg and defaultbg when resizing
Avoids blinding white flashes. Maybe the "wrong" way, but all terminals I have
checked follow this way.
2021-08-01 20:35:32 +05:30
Ashish Kumar Yadav aedb0502c6 Clear history buffer on treset 2021-08-01 20:04:38 +05:30
Ashish Kumar Yadav d38d0e399c Removed WM_ICON_NAME and implemented titlestack
This reverts 28b4c822c5 and
4ef0cbd8b9.
Also implements titlestack and support for CSI 22 and 23.
2021-08-01 19:31:17 +05:30
Ashish Kumar Yadav 2726f5f68c Improved scroll bindings 2021-08-01 11:37:33 +05:30
Ashish Kumar Yadav 87517faba7 Shouldn't type be updated before the call, since selnormalize uses type 2021-08-01 04:37:28 +05:30
Ashish Kumar Yadav deb4f885c2 More appropriate I guess - gp->mode to ATTR_NULL rather than 0 2021-08-01 00:02:41 +05:30
Ashish Kumar Yadav edcc9ee4e1 Don't use current attributes for history lines 2021-07-31 23:45:49 +05:30
Ashish Kumar Yadav 635eaac216 Fixed selection bug in tresize 2021-07-31 19:32:34 +05:30
Ashish Kumar Yadav a18b9fc4fc Fixed bug from 3138d93aa2 in tresize 2021-07-31 03:06:47 +05:30
Ashish Kumar Yadav bd8912b638 Fixed selection clearing on resize
Even if the horizontal size is increasing, selection should be cleared
if it spans across lines, otherwise it would get corrupted.
2021-07-30 12:36:04 +05:30
Ashish Kumar Yadav 54cf78ab24 This is more appropriate - tresize 2021-07-30 12:30:01 +05:30
Ashish Kumar Yadav f10e350434 Cleanup; renamed st-0.8.4 to st 2021-07-29 21:14:52 +05:30
Renamed from st-0.8.4/st.c (Browse further)