fix(gui): double return on mac/linux (#2311)

This commit is contained in:
Ellie Huxtable 2024-07-25 16:08:53 +01:00 committed by GitHub
parent 128891f53e
commit c408465549
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 490 additions and 692 deletions

1156
ui/backend/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,7 @@ vt100 = "0.15.2"
bytes = "1.6.0"
nix = "0.29.0"
lazy_static = "1.5.0"
tauri-plugin-os = "2.0.0-beta.8"
[target."cfg(target_os = \"macos\")".dependencies]
cocoa = "0.25"

View File

@ -15,11 +15,13 @@
"sql:allow-load",
"sql:allow-execute",
"sql:allow-select",
"os:allow-platform",
"window:allow-start-dragging",
{
"identifier": "http:default",
"allow": ["https://api.atuin.sh/*"]
}
},
"os:default"
],
"platforms": ["linux", "macOS", "windows"]
}

View File

@ -282,6 +282,7 @@ fn show_window(app: &AppHandle) {
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_shell::init())
.invoke_handler(tauri::generate_handler![
list,

View File

@ -3,7 +3,7 @@ use std::io::BufRead;
use std::path::PathBuf;
use crate::state::AtuinState;
use tauri::{Manager, State};
use tauri::{Manager, State, Emitter};
use atuin_client::{database::Sqlite, record::sqlite_store::SqliteStore, settings::Settings};

View File

@ -32,6 +32,7 @@
"@tanstack/react-virtual": "^3.8.3",
"@tauri-apps/api": "2.0.0-beta.15",
"@tauri-apps/plugin-http": "2.0.0-beta.8",
"@tauri-apps/plugin-os": "2.0.0-beta.7",
"@tauri-apps/plugin-shell": "2.0.0-beta.8",
"@tauri-apps/plugin-sql": "2.0.0-beta.5",
"@types/luxon": "^3.4.2",

View File

@ -71,6 +71,9 @@ dependencies:
'@tauri-apps/plugin-http':
specifier: 2.0.0-beta.8
version: 2.0.0-beta.8
'@tauri-apps/plugin-os':
specifier: 2.0.0-beta.7
version: 2.0.0-beta.7
'@tauri-apps/plugin-shell':
specifier: 2.0.0-beta.8
version: 2.0.0-beta.8
@ -5148,6 +5151,12 @@ packages:
'@tauri-apps/api': 2.0.0-beta.15
dev: false
/@tauri-apps/plugin-os@2.0.0-beta.7:
resolution: {integrity: sha512-CHo09ecxUU0NFkAqctXeQzdaXw02EXulqcaZnbjrBfRJ2ulmGq7zaUCsHihfcqWcdnmNwmP9Wh/gyznMc1JF9Q==}
dependencies:
'@tauri-apps/api': 2.0.0-beta.15
dev: false
/@tauri-apps/plugin-shell@2.0.0-beta.8:
resolution: {integrity: sha512-rFXI6MvsCdSGbuKbDu/NaOePREb9YTVTdeugHdvvljnKWW3dvmThBb2h/8Hxj+Z7Cd8MUoRxPeJWUZbPbJ2Imw==}
dependencies:

View File

@ -10,6 +10,7 @@ import { Play, Square } from "lucide-react";
import { useState } from "react";
import { extensions } from "./extensions";
import { platform } from "@tauri-apps/plugin-os";
import { invoke } from "@tauri-apps/api/core";
import Terminal from "./terminal.tsx";
@ -72,7 +73,10 @@ const RunBlock = ({
if (currentRunbook) incRunbookPty(currentRunbook);
let val = !value.endsWith("\n") ? value + "\r\n" : value;
let isWindows = platform() == "windows";
let cmdEnd = isWindows ? "\r\n" : "\n";
let val = !value.endsWith("\n") ? value + cmdEnd : value;
await invoke("pty_write", { pid: pty, data: val });
}
};

View File

@ -98,7 +98,7 @@ export default function Dotfiles() {
console.log(current);
return (
<div className="w-full flex-1 flex-col p-4">
<div className="w-full flex-1 flex-col p-4 overflow-y-auto">
<div className="p-10">
<Header current={current} setCurrent={setCurrent} />
Manage your shell aliases, variables and paths