mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-21 20:21:09 +03:00
terminal works basically. (#12189)
* terminal works basically. todo: - persistent - sessions restore - web - mobile * missed terminal persistent option change * android sdk 34 -> 35 * +#![cfg_attr(lt_1_77, feature(c_str_literals))] * fixing ci * fix ci * fix ci for android * try "Fix Android SDK Platform 35" * fix android 34 * revert flutter_plugin_android_lifecycle to 2.0.17 which used in rustdesk 1.4.0 * refactor, but break something of desktop terminal (new tab showing loading) * fix connecting...
This commit is contained in:
@@ -103,6 +103,8 @@ pub fn peer_get_sessions_count(id: String, conn_type: i32) -> SyncReturn<usize>
|
||||
ConnType::PORT_FORWARD
|
||||
} else if conn_type == ConnType::RDP as i32 {
|
||||
ConnType::RDP
|
||||
} else if conn_type == ConnType::TERMINAL as i32 {
|
||||
ConnType::TERMINAL
|
||||
} else {
|
||||
ConnType::DEFAULT_CONN
|
||||
};
|
||||
@@ -129,6 +131,7 @@ pub fn session_add_sync(
|
||||
is_view_camera: bool,
|
||||
is_port_forward: bool,
|
||||
is_rdp: bool,
|
||||
is_terminal: bool,
|
||||
switch_uuid: String,
|
||||
force_relay: bool,
|
||||
password: String,
|
||||
@@ -142,6 +145,7 @@ pub fn session_add_sync(
|
||||
is_view_camera,
|
||||
is_port_forward,
|
||||
is_rdp,
|
||||
is_terminal,
|
||||
&switch_uuid,
|
||||
force_relay,
|
||||
password,
|
||||
@@ -613,6 +617,33 @@ pub fn session_send_chat(session_id: SessionID, text: String) {
|
||||
}
|
||||
}
|
||||
|
||||
// Terminal functions
|
||||
pub fn session_open_terminal(session_id: SessionID, terminal_id: i32, rows: u32, cols: u32) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.open_terminal(terminal_id, rows, cols);
|
||||
} else {
|
||||
log::error!("[flutter_ffi] Session not found for session_id: {}", session_id);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_send_terminal_input(session_id: SessionID, terminal_id: i32, data: String) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.send_terminal_input(terminal_id, data);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_resize_terminal(session_id: SessionID, terminal_id: i32, rows: u32, cols: u32) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.resize_terminal(terminal_id, rows, cols);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_close_terminal(session_id: SessionID, terminal_id: i32) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.close_terminal(terminal_id);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_peer_option(session_id: SessionID, name: String, value: String) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.set_option(name, value);
|
||||
|
||||
Reference in New Issue
Block a user