Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion THIRD-PARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ ghostty_vte:
git:
url: https://github.com/antgrid-ai/dart_terminal.git
path: pkgs/vte/ghostty_vte
ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c
```

`ghostty_vte_flutter` and `portable_pty` are pinned to the same repository and
Expand Down
19 changes: 13 additions & 6 deletions app/lib/util/external_url.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Future<void> openTerminalHyperlink(
}
return;
}
if (_revealsDestinationOnHover) {
if (_browserRevealsDestination) {
await open(context, target.toString());
return;
}
Expand All @@ -130,11 +130,18 @@ Future<void> openTerminalHyperlink(
}
}

/// Whether this platform shows a link's destination before it is activated.
/// Whether opening the link lands somewhere that reads the destination back.
///
/// Desktop does, through the terminal's hover affordance, so a click there is
/// already an informed one. Touch has no hover, which is why the mobile path
/// asks instead.
bool get _revealsDestinationOnHover =>
/// Desktop hands the URI to a browser whose address bar does, which is the same
/// disclosure every terminal leans on. The terminal's own hover affordance is
/// NOT it and never was: the view only swaps the cursor to a pointer, and
/// nothing there or here paints the URI.
///
/// Mobile has no such guarantee. An `https:` host holding a verified App Link
/// opens that app instead of any browser (see [openableTerminalHyperlink]), so
/// the destination can be acted on without ever being shown. That is why the
/// mobile path asks first, and why the answer to a spoofed target on desktop is
/// a hover preview rather than the same sheet on both.
bool get _browserRevealsDestination =>
defaultTargetPlatform != TargetPlatform.android &&
defaultTargetPlatform != TargetPlatform.iOS;
6 changes: 3 additions & 3 deletions app/lib/widgets/terminal_hyperlink_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import '../design/widgets/ab_dialog.dart';
///
/// OSC 8 lets a link's visible text disagree with its destination, so the text
/// a user taps is not evidence of anything: `https://github.com@evil.example/`
/// reads as GitHub and resolves to `evil.example`. Desktop reveals the target
/// on hover before the click; touch has no hover at all, so without this the
/// destination is never shown before the browser is already open.
/// reads as GitHub and resolves to `evil.example`. Desktop gets its disclosure
/// from the browser's address bar; a tap here may never reach a browser at all,
/// because a verified App Link opens its own app instead.
///
/// Returns false when dismissed, so a stray tap outside the sheet cancels.
Future<bool> showTerminalHyperlinkSheet(
Expand Down
12 changes: 6 additions & 6 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -682,17 +682,17 @@ packages:
dependency: "direct overridden"
description:
path: "pkgs/vte/ghostty_vte"
ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
resolved-ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c
resolved-ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c
url: "https://github.com/antgrid-ai/dart_terminal.git"
source: git
version: "0.1.4+antgrid.1"
ghostty_vte_flutter:
dependency: "direct main"
description:
path: "pkgs/vte/ghostty_vte_flutter"
ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
resolved-ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c
resolved-ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c
url: "https://github.com/antgrid-ai/dart_terminal.git"
source: git
version: "0.1.4+antgrid.1"
Expand Down Expand Up @@ -1204,8 +1204,8 @@ packages:
dependency: "direct overridden"
description:
path: "pkgs/pty/portable_pty"
ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
resolved-ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c
resolved-ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c
url: "https://github.com/antgrid-ai/dart_terminal.git"
source: git
version: "0.0.6+antgrid.2"
Expand Down
6 changes: 3 additions & 3 deletions app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,17 @@ dependency_overrides:
git:
url: https://github.com/antgrid-ai/dart_terminal.git
path: pkgs/vte/ghostty_vte_flutter
ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c
ghostty_vte:
git:
url: https://github.com/antgrid-ai/dart_terminal.git
path: pkgs/vte/ghostty_vte
ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c
portable_pty:
git:
url: https://github.com/antgrid-ai/dart_terminal.git
path: pkgs/pty/portable_pty
ref: ce7f469dba73216843a3c684b0697b0f8a5ec64c
ref: f8e2e8201c7bef116ec04baa4cfc039acb53e29c

# Microsoft Store packaging (MSIX). The Store signs the package itself, so no
# code-signing cert is used on this path (unlike the Inno Setup installer in
Expand Down