548 Commits
Author SHA1 Message Date
osy a9d9673300 Ignore gestures on subviews 2022-05-23 17:11:22 -07:00
osy 4f4592f2a8 Lower minimum iOS deployment target to iOS 11
The following limitations show up when running on < iOS 13
- Icons in accessory view are unavailable
- Dark mode is unavailable and colours default to light mode
- UIFont.monospacedSystemFont is unavailable so default font is "Menlo"
2022-05-22 21:31:58 -07:00
Miguel de Icaza 43ca63b501 Various memory leak fixes in Terminal 2022-05-06 13:38:25 -04:00
Miguel de Icaza a422359674 When the selection is set to active, always notify of a change, we were missing key updates after the last code deduplication. Also, add some debugging aids 2022-05-05 16:42:27 -04:00
Miguel de Icaza fb1c3be376 Fix issue reported on TestFlight: 'Was sshed to Linux host in less, going to top and bottom of file with key commands.' 2022-05-05 16:23:12 -04:00
Miguel de Icaza 2066ad05fe Make the tests work on modern macOS that lacks Python 2.7 2022-05-05 16:22:05 -04:00
Miguel de Icaza c7bf7884b9 I commited the wrong selection fix, this does the actual validation that was intended 2022-05-05 16:21:52 -04:00
Miguel de Icaza f2c34f123d There are two codepaths for text insertion, and my previous patch for handling newlines only handled one. In addition to handling regular input from the keyboard, the input mechanism might send a newline, convert this to the sequence there as well 2022-05-03 23:09:26 -04:00
Miguel de Icaza 2b52b9c720 Be more generous with the space on the iPad, I think I could add more gadgets here 2022-05-02 17:55:54 -04:00
Miguel de Icaza 126034379f Break a cycle in the buffer 2022-04-30 21:48:48 -04:00
Miguel de Icaza 50d785a0dd Harden text input, crash reported here 2022-04-16 22:51:24 -04:00
Miguel de Icaza 9bf4413ed6 iOS: Process all presses provided to pressesEvents, like the Apple
documentation recommends.  Althought I have never seen one of these
events come with more than one key, nonetheless, it makes sense.

iOS: install a timer when a key is pressed, and starts 0.4 seconds
after the event, and repeats every 0.1 to get us auto-repeat
functionality.  This values are hardcoded and match the values in the
Settings/Accessibility/Keyboard settings, as there does not seem to be
a way on iOS to retrieve these globals (on Mac, with AppKit, these are
constants in NSEvent).

Fix the build for Mac, by keeping the old #if os(iOS) around the section
that does the selection highlight.
2022-04-16 10:27:10 -04:00
Miguel de Icaza 898e2f2d46 When the terminal changes its size, kill the selection. Also, there is no need for selectNone() to call selectionChanged, as active does that for us 2022-04-15 16:31:47 -04:00
Miguel de Icaza 5561564c41 Implement the informal protocol to surface the Copy, Paste and Select All options. This surfaces these commands on the iPad context menu 2022-04-15 13:49:22 -04:00
Miguel de Icaza 3e53372c97 Do not capture regular keys if the command key is pressed, as that is likely captured by consumers as a hotkey 2022-04-15 13:26:29 -04:00
Miguel de Icaza 2629cc146b iOS/Style: need to draw the selection handles after the buffer is drawn, otherwise the next line overrides parts of the handle 2022-04-14 16:19:16 -04:00
Miguel de Icaza fe0f8b67a9 Close the context popup if the selection is removed 2022-04-14 15:37:54 -04:00
Miguel de Icaza 43b9810a95 The field 'sentData' was a debugging aid that was committed, should have never been done this way, fix it
Additionally, if we have no data to be sent, be a good iOS citizen and send the unhandled
event to our super as described in "Focus on iPad keyboard navigation" from WWDC 2021
2022-04-12 11:46:48 -04:00
Miguel de Icaza 341317e628 Make the SwiftTerminal focusable for iPad 2022-04-12 11:30:38 -04:00
Miguel de Icaza 8aeeb8fc80 iOS: Sends a carriage return when the return key is pressed, rather than newline. This seems to work on both Unix and Windows hosts. Added a property that can be configured externally if the user desires to change this 2022-04-12 10:31:53 -04:00
Miguel de Icaza 4d33ba5a69 Fix some selection issues with a disconnect between screen-visible position, and buffer-relative positions, I think the long-term correct solution is to have two data types to avoid mixing those up by accident 2022-04-07 18:08:01 -04:00
Miguel de Icaza dcdda89893 Do not extend if the pivot was not previously set to match iOS behavior (close, iOS would do a 'drag' at this point) and change the pivot point 2022-04-07 17:38:10 -04:00
Miguel de Icaza 71fd497243 iOS: Rather than using Mac-desktop semantics for selection and extending, use an iOS-styled pivot for the selection 2022-04-07 17:06:29 -04:00
Miguel de Icaza 04632894a4 Make my life easy 2022-04-07 17:05:34 -04:00
Miguel de Icaza 32d7f8f62b Change the rendering of any padding to not be the extension of the attributes on the last line 2022-03-25 17:52:03 -04:00
Miguel de Icaza d661230c69 Some documentation touch-ups 2022-01-13 11:31:58 -05:00
Miguel de Icaza dc592c57d3 Fix Mac build on actions 2022-01-13 11:23:47 -05:00
Miguel de Icaza 1b325efdfa Merge pull request #204 from krzyzanowskim/marcin/terminate-localprocess
Terminate local process
2022-01-13 11:14:14 -05:00
Marcin Krzyzanowski 2b617db718 terminate process with SIGTERM 2022-01-12 19:06:25 +01:00
Marcin Krzyzanowski 8db7bc3820 Terminate local process 2022-01-12 02:35:20 +01:00
Miguel de Icaza 841c20c26c Fix for #197, from Daniel Fischer, update the color parsed, not the foreground color 2021-11-01 21:25:48 -04:00
Miguel de Icaza a1c420bc67 Merge pull request #198 from kevinfr95/main
Add check for position when one of them is not defined
2021-11-01 21:20:13 -04:00
= 8dcce2fdf8 Add check for position when one of them is initial 2021-10-19 18:19:26 +02:00
Miguel de Icaza 8094937a8b The system might call frame or bounds, not just bounds as I previously thought 2021-08-04 23:12:51 -04:00
Miguel de Icaza 731731c029 Band aid until the Xcode regression is solved 2021-07-20 17:32:50 -04:00
Miguel de Icaza 67e301b66e Move some common APIs from MacTerminalView to AppleTerminalView so they can be used on iOS as well 2021-07-17 23:57:02 -04:00
Miguel de Icaza a09826cc9d Disable the debug logging of data 2021-07-17 00:35:28 -04:00
Miguel de Icaza c4547d91ae If the selection is not active, do not trigger the selectionChanged to nothing 2021-07-17 00:35:06 -04:00
Miguel de Icaza 1febeffb3d Missing if(iOS) 2021-07-16 23:58:25 -04:00
Miguel de Icaza 0219f53cf3 Small UI touchup for the keyboard, larger buttons on iPad (by fixing a bug), reuse some code 2021-07-15 23:23:13 -04:00
Miguel de Icaza fad3c53315 Implement the helper keyboard.
SwiftTerm already has an inputAccessoryView that would provide a
handful of terminal commands that the iOS keyboard does not provide,
but lacked additional keys.

Now, it features a keyboard that can be displayed on demand that contains
helper keys, like function keys and other common keys.

Additionally, I introduced a darker color for some keys that do not
insert text, but have more editing capabilities, and it works on both
light and dark modes, and supports switching dynamically.
2021-07-15 22:55:43 -04:00
Miguel de Icaza c51ddee19b Better use of space on iPads 2021-07-14 18:12:25 -04:00
Miguel de Icaza a262dea69e Keyboard accessory improvement: Started as a dual-input keyboard button patch, but in the end, managed to get everything to fit in both small and large iPhone form factors; Will likely still use the dual-button for other scenarios. Untested on the iPad size 2021-07-13 23:17:29 -04:00
Miguel de Icaza 24f4a8e046 Change the name 2021-07-13 21:26:08 -04:00
Miguel de Icaza 5cfb75fa16 Add file 2021-07-13 20:15:43 -04:00
Miguel de Icaza 6614b86f07 Allow pan gestures to be a cursor key when the allowMouseReporting is false, and provide some visual feedback; Undo the changes to allow external inputViews, as that did not work out at all 2021-07-01 23:09:54 -04:00
Miguel de Icaza 29e132a363 The "allowMouseReporting" inputAccessoryItem is no longer surfaced
here, instead, took the space for the auxiliary keyboard input, which
is now requested from a client app - the only reason is that the
prototype I wrote uses SwiftUI, and I need a UIViewController to do
the view rehosting, and that is not possible on the library itself.

Maybe I could rewrite the keyboard with UIKit, but it just does not
seem remotely as fun.

iOSAccessoryView: the referece to the parent terminal and the
terminalView are now properly weak.

Moved extensions for the UIKit and AppKit into their separate files.
2021-06-29 22:24:46 -04:00
Miguel de Icaza 6070699470 Small usability tune up: hide the menu on a tap 2021-06-26 00:03:35 -04:00
Miguel de Icaza 8617159525 Fix Mac Build 2021-06-25 23:51:15 -04:00
Miguel de Icaza 4ee1baefa8 iOS TerminalView: change the way selection works in a few ways. Now,
it behaves more like a text input control in iOS.  A long-press will
add a "Select" option.

New selection markers are rendered, which can be used to adjust the
selection and these will scroll the view as well if they are near the
edge.

fuzzyHasSelectionBackground: Fixes the selection rendering on iOS, the
logic to return always true was wrong, it has to be true in one case,
false in the other.

Some behavioral changes to better match the iOS behavior:

- Long press will open a context menu, where it is possible to start a
  selection.

- Selecting "Select" after a long press, shows a new menu with
  additional context options.

- Menu is shown at the end of a pan operation when selection is on.

Additional property to control the color handles for the selection
2021-06-25 23:41:30 -04:00