Commit Graph

148 Commits

Author SHA1 Message Date
Boris Faure 1f3f779258 ensure cursor coordinates are always valid 2015-06-02 22:48:50 +02:00
Boris Faure c86b35309c rename a bunch of _termpty_*() to termpty_*() 2015-06-02 21:47:06 +02:00
Boris Faure be62d87f89 separate "termstate" from cursor state and screens. Closes T725 2015-04-23 20:02:53 +02:00
Boris Faure 4abdf4b327 code cleanup: s/if (X) free(X);/free(X);/ 2015-03-18 15:23:39 +01:00
Boris Faure ed178f5a13 typo 2015-03-17 18:47:26 +01:00
Boris Faure 7edeea3503 correctly swap term states. Ref T725 2015-03-17 17:15:50 +01:00
Boris Faure b4ba773e17 fix CSI DECSET 1049. Should fix T725 2015-03-01 17:20:18 +01:00
Boris Faure 27304c456f make terminology start on solaris 2015-02-23 23:33:06 +01:00
Boris Faure cf1a9a3a01 verify that tcgetattr() does not fail 2015-02-23 23:33:01 +01:00
Boris Faure e4d357ace2 make terminology work on solaris
tcsetattr() should only be called on the slave fd. On linux, both master
or slave are accepted, not on solaris.
2015-02-17 22:08:47 +01:00
Carsten Haitzler 6268dc32e4 terminology - fix double click selection and jed display
this fixes breaks introduced by
e94051dd86 (the previous commit).

latest commit: e94051dd86

breaks 2 things.

1. double-click to select a "word" is broken. the right end of the selection is
stuck at the point where the cursor is, not the right end of the word. try it.
at least that is what i see. either way double-click to select a word is now
broken. ;(

2. what used to be black whitespace bg is now "empty" chars (so i see
terminology bg). this breaks jed output pretty badly.

see...

working:
http://www.enlightenment.org/ss/e-54d05f357a3391.24747752.png

not working:
http://www.enlightenment.org/ss/e-54d05f672a4df7.83729511.png
2015-02-03 14:45:23 +09:00
Boris Faure e94051dd86 make selection consistent when selecting space with no text. Closes T2013 2015-01-30 00:24:55 +01:00
Boris Faure cd04b71611 check tcsetattr() 2015-01-10 21:02:05 +01:00
Boris Faure 7f98dba714 set a title to the term based on the shell started 2014-12-16 22:11:06 +01:00
Boris Faure cbc92a55fc Fix screen mangling from prompt redraws on resize. Closes T1193
There are still some oddities because the shell doesn't expect us to
reflow.

Let's say we have the following where X is the cursor.

+-------+
|foobar$|
|X      |
+-------+
Here, the shell explicitly told us to go to a new line after '$'. We don't
consider '$' is on the same line as 'foobar'.
Decrease the width of that window.
+------+
|foobar|
|$     |
|X     |
+------+
Let the shell know the new size. It decides to redraw the prompt. It
remembers it told us to go to a new line, so the first thing it tells us
is to go one line up: to '$' and not 'foobar'. Then it tells us to clear
the screen downward from there and to print "foobar$" (and go to new
line).

Thus we have the following:
+------+
|foobar|
|foobar|
|$     |
|X     |
+------+
2014-12-07 23:51:23 +01:00
Boris Faure 978f83dc03 just sighup the shell, don't sigpipe it. Closes T1685 2014-09-28 13:46:04 +02:00
Boris Faure b9a994c4bd fix compilation. I'm tired… 2014-09-15 23:30:48 +02:00
Boris Faure 2eb2b9646f fix segfault when OOM on the termpty_save module 2014-09-15 22:07:22 +02:00
Boris Faure 90c53f5974 fix CID 1238659: Dereference after null check (FORWARD_NULL) 2014-09-15 21:04:26 +02:00
Boris Faure 51555f9c35 fork can fail 2014-09-14 22:46:22 +02:00
Boris Faure 6d4219137f try to handle OOM on "termpty_save" 2014-09-14 14:11:14 +02:00
Carsten Haitzler 15b55d5eb7 Revert "do not crash when the scrollback mempool is OOM"
This reverts commit 815a357ad9.

this patch breaks paging and backscroll completely. just try less or
more - eg

man ls

then resize the window. :)
2014-09-10 16:57:32 +09:00
Boris Faure 815a357ad9 do not crash when the scrollback mempool is OOM 2014-09-08 21:28:26 +02:00
Boris Faure 601450db01 review translation strings. Closes T1433 2014-07-26 11:37:27 +02:00
Boris Faure 8a3c15e08e gettextify termcmd.c,termio.c,termpty.c,termptyesc.c 2014-07-26 11:37:26 +02:00
Boris Faure 2b9c9a8351 add some padding fields to be sure holes are initialized (hi valgrind!) 2014-05-08 13:55:01 +02:00
Boris Faure 9346db3ba7 initialize some variables 2014-03-25 21:57:34 +01:00
Boris Faure 0313446e79 let's try to recover from malloc failure: ahah 2014-03-25 21:43:49 +01:00
Boris Faure 8f3258f1b3 use a bit more Eina_Unicode 2014-03-25 21:35:31 +01:00
Sebastian Dransfeld 2263fd872e return after failed memory allocation
CID 1100649
2014-03-24 13:38:42 +01:00
Sebastian Dransfeld 1c53e10b42 don't write to NULL buffer
If we have checked for allocation failure, no need to write to buffer.

CID 1100648
2014-03-24 13:37:07 +01:00
Sebastian Dransfeld fe45b5c73f remove weird check
After allocation of new_screen, we should check the allocation of this
variable, and return if we cannot allocate.

CID 1100647
2014-03-24 13:35:08 +01:00
Aleksandar Popadić ca143565a4 Fix disappearing prompt on resize
...and break reflow of multiline prompt lines.
2014-03-15 21:40:05 +01:00
Boris Faure 864fa1e368 set IUTF8 flag. Closes T656 2014-01-29 22:57:49 +01:00
Boris Faure 7cc50d4e05 fix wrong cast. thanks to OnlyHuman 2014-01-22 23:22:42 +01:00
Carsten Haitzler 870d592139 set EMOTION_ENGINE to tyls (and ethumb etc.) can use it inside shell
this should fix T291
2014-01-22 20:32:25 +09:00
Aleksandar Popadić 4ed6ca9385 Close T643 for the time being.
Reviewers: billiob

Maniphest Tasks: T643

Differential Revision: https://phab.enlightenment.org/D408
2013-12-25 11:57:13 +01:00
Aleksandar Popadić 59a7627e86 Fix reflow on resize when in alternate buffer. Closes T637
Summary:
After commit 05d091483a screen swap form
alternate buffer to primary buffer is not the same as the reversed. Take this
into account when resizing.

Test Plan: Build history, man echo, resize, quit manual.

Reviewers: billiob

Differential Revision: https://phab.enlightenment.org/D370
2013-12-10 21:23:32 +01:00
Carsten Haitzler 6cbc4c1a09 wrap code - line2 COULD be NULL technically, so handle that case 2013-12-06 19:00:23 +09:00
Boris Faure 05d091483a fix changing state when swapping buffers. Closes T605
For some reason, this is not a real swap. Thanks to gregkh for the great
bug report.
2013-12-05 22:48:58 +01:00
Aleksandar Popadić b31638a630 Fix resize from width=1 to wider.
Test Plan:
Shrink terminal to width=1 and expand. Empty lines appear above
prompt line.

Reviewers: billiob

Differential Revision: https://phab.enlightenment.org/D361
2013-12-02 21:51:03 +01:00
Boris Faure fa0cdc0e1d remove unused parameter 2013-12-01 23:19:54 +01:00
Aleksandar Popadić d0c6c1d457 Rewrite reflow on resize
Summary:
simplify code (treat every resize as a single case) and fill the lines
from the bottom up

Reviewers: billiob

Differential Revision: https://phab.enlightenment.org/D355
2013-12-01 19:47:12 +01:00
Aleksandar Popadić 11db9a1117 Fix screen swap when using alternate buffer.
Summary:
The circular_offset should not be set to 0 because the first line from
screen2 is copied to the offset line in screen.

Test Plan:
Try "man echo", scroll down and exit. The screen is not restored
properly.

Reviewers: billiob

Reviewed By: billiob

Differential Revision: https://phab.enlightenment.org/D345
2013-11-22 22:17:02 +01:00
Boris Faure df2b87308b add termpty_screen_swap() to simplify code 2013-11-18 21:41:30 +01:00
Aleksandar Popadić 7447178071 Fix screen refresh with screen, ssh, vim, ...
Summary: This closes T143.

Reviewers: billiob

Reviewed By: billiob

Maniphest Tasks: T143

Differential Revision: https://phab.enlightenment.org/D340
2013-11-18 20:45:47 +01:00
Boris Faure 4d629c5575 do not try to reflow altbuf 2013-11-10 15:34:40 +01:00
Cedric Bail 433b18b211 terminology: let the compiler inline more agressively the common case for a 1% win. 2013-10-28 18:55:19 +09:00
Carsten Haitzler 8585c3e9c2 maybe speed up term scroll byt skipping compare work
since nothing useful is actually done unless either oldc or newc have
a media char - then try return/skip early. might speed up by 2-5%...
(i see 4.05 vs 4.15 or so cat times for a test case).
2013-10-25 23:37:10 +09:00
Boris Faure f539eba7ca screw terminfo: have a config to decide whether erase is del or backspace
One day I'll have to dig into the terminfo/termcap mess :(
Maybe get the O'Reilly book about it…
2013-09-26 21:19:18 +02:00