24 Commits
Author SHA1 Message Date
Miguel de Icaza 35f80d52cc Brings to Mac the same bounds fix that I did to iOS, where I was queuing
the wrong chunk of data.

Starting with BigSur any screen updates will invoke the draw() method
with the whole region, regardless of how much changed.

Added a new `disableFullRedrawOnAnyChanges` property that by default
will make the Terminal avoid this new behavior.   It can be controlled
by client code.

Setting this to true, will disable this OS behavior, setting it to
false, will keep the original BigSur behavior to redraw the whole
region.

For more details on this see:

https://gist.github.com/lukaskubanek/9a61ac71dc0db8bb04db2028f2635779
https://developer.apple.com/forums/thread/663256?answerId=646653022#646653022

Added an NSView.rectsBeingDrawn method to get the exposed areas - also
sort of worthless on BigSur an older if the flag is not set.
2021-06-18 19:56:18 -04:00
Miguel de Icaza 3cbda01601 Sixel progress: I do like this approach a lot more. Now, when an
image has bee completed, it is the job of the front-end to insert
it in a way that is suitable.

In the Mac+iOS cases, I divide the image in bands, and attach each
band to the display, this ensures that images work when scrolling
and that no odd repaint side effect happens when we update portions
that were not the "reference" row that contained the image.   Now,
every row has the image it needs to display.

Leveraged the Bufferline structure, and placed an optional array of
images there.   The images contain the column where they were
attached, so the front-end can iterate over the images (typically,
no more than one) to redraw.

Fixed also the HLS to RGB conversion, and does this without requiring
the core of the terminal to rely on UIKit or AppKit, so this should
be finally back to reusable on non-Apple platforms.
2021-04-21 22:23:52 -04:00
Miguel de Icaza 73e8777044 Make bracketed paste mode public, style 2021-03-30 22:50:48 -04:00
Miguel de Icaza fc667c2d2b Use the system configured shell, instead of hardcoding bash 2020-12-07 22:38:33 -05:00
Miguel de Icaza 12ce12a779 Launch bash as a login shell; Set startup directory to be the home directory 2020-12-07 17:56:06 -05:00
Miguel de Icaza 367ca20539 Drop the git submodule, and instead use remote XCFraweworks (#152)
This should make it a lot simpler for users that wanted to take this for a spin.

Most forks were dealing with this.
2020-11-30 22:48:33 -05:00
Miguel de Icaza 1ed974b5c6 Mac app: export buffer, export selection; Library: API to expose contents as Data; Update localhost testing address 2020-11-30 21:56:30 -05:00
Miguel de Icaza 075fd23965 Fix the iOS build, and use the new SwiftSH.xcframework 2020-11-29 23:06:49 -05:00
Miguel de Icaza 4abff67a68 Wire up the OSC current-directory command to the Mac sample app 2020-11-27 14:57:21 -05:00
Miguel de Icaza dcb3c8d0e0 Better background processing (#147)
* Exploration on making the input parsing a background task - and let the UI run free

* The multi-threaded renderer idea works.

The general idea is to move away from the idea that the view is
updated after text is fed into the TerminalView, as this can hang the
UI when large amounts of data are fed into the terminal (this happens
with an ssh connection when a command sends too much data over the
connection).

The idea is instead to run a CADisplayLink that updates the display
at discrete intervals and send the data to the terminal on a
background thread.

For this to work, the queue that I was using for SSH needs to be
serialized, and I had it configured as concurrent in
UIKitSshTerminalView, so that should also be fixed on master.

Some challenges with this approach, which prevent this from being
merged right now.

1. The messages posted from the terminal into the delegate are done
from the background thread (the one that is calling parse).   Either,
I provide an explicit queue to deliver messages, or the terminal could
pick the queue on which it was created to deliver messages on.

2. The CADisplayLink can be expensive when nothing is happening, so
probably it should be turned off when no data has been pushed, or have
a small boolean that indicates whether any data has been fed,
otherwise, to return immediately.

* Multi-threading: Pause the display update when there are no changes, currently only iOS has been wired up

* Two performance optimization: preload the content of self.buffer to avoid multiple nested calls in insertCharacter, and copyFrom can rely on Swift's array copy-on-write semantics instead of copy data like a troglodyte

* EscapeSequenceParser: while it took a slice, it was iterating not over the startIndex..endIndex, but startIndex..len which could have been smaller, so it was not really working with slices

* Undo the locking-based multi-threading, and instead buffer output in chunks from SSH data receiver

* Update comments to reflect the two bugs fixes, and the now desired pattern to use it

* Make multithreading build on Mac
2020-10-27 17:17:46 -04:00
Miguel de Icaza e15afadd1c Usability: make the TerminalView font settable by the native font, not via our internal font structure; Mac terminal app - hook up the zoom in/out/magnification/reset size events 2020-06-04 20:18:46 -04:00
Miguel de Icaza 91e4a0b5fa Add support for transparent backgrounds to Mac and iOS 2020-05-29 20:03:43 -04:00
Miguel de Icaza d5ab249b56 Add universal binaries for SwiftSH 2020-05-12 23:00:29 -04:00
Miguel de Icaza e437ee4beb iOS InputAccessory support, implement some of the keys, and add some refactoring needed 2020-05-11 00:50:02 -04:00
miguel 9c5520f9eb Revert the patch change, this should get it building 2020-05-09 14:20:50 -04:00
Miguel de Icaza 4117d7870b Should fix once and for all the SwiftSH.binaries module.modulemap clash 2020-05-08 23:55:51 -04:00
Miguel de Icaza 478dc1d3b6 iOS: Take keyboard size into consideration, remove debugging junk, disable iOS chuning for now 2020-05-04 00:01:20 -04:00
Miguel de Icaza cbbe20c46f Disable chunking for now, it is triggering a redraw problem 2020-05-03 22:53:37 -04:00
Miguel de Icaza aed87e2973 iOS: process incoming data in chunks, otherwise, we would only get UI updates after massive chunks of data have been sent. In my local case, I would get two megabytes worth of data on a large transfer, and the UI would not update for the whole time this was being processed. 2020-05-03 17:56:29 -04:00
Miguel de Icaza ef62a251d1 Implement foreground/background color changes, fix bugs in the palette update code (it was not redisplaying changes - subtle, I was using the wrong index, one that did not take bold into account); implements palette reset as well - pending the actual changes to UI colors, see bug #111 2020-05-03 00:04:14 -04:00
Marcin Krzyzanowski 359447eebe Update Info.plist paths 2020-04-28 20:45:05 +02:00
Marcin Krzyzanowski 09879b4ce3 Merge branch 'master' into marcin/reorganize 2020-04-28 20:41:48 +02:00
Marcin Krzyzanowski b0c796be38 Include iOSTerminal project 2020-04-28 19:11:33 +02:00
Marcin Krzyzanowski 10db3c3896 Reorganize project. Move terminal apps into TerminalApp directory. Reference project from SwiftTErm.xcworkspace for Xcode 2020-04-28 12:58:18 +02:00