summaryrefslogtreecommitdiffstats
path: root/zellij-server/src/unit/tab_tests.rs
diff options
context:
space:
mode:
authorspacemaison <tuchsen@protonmail.com>2021-09-10 08:35:06 -0700
committerGitHub <noreply@github.com>2021-09-10 17:35:06 +0200
commit4f94f95c90a0b5c2cb3992533cec40cc55f05983 (patch)
tree006824300f43717d08862eeb8ebb08c151dd62c4 /zellij-server/src/unit/tab_tests.rs
parent26a970a7d8a0f3703124ab3bb57cff4d296a2e33 (diff)
feat(cwd-pane): Keeping the cwd when opening new panes (#691)
* feat(cwd-pane): Add a new trait to get the cwd of a given pid Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Allow for setting the cwd when spawning a new terminal Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Add an active_pane field to the Pty struct Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Update Pty with Tab's active pane id Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Refactor spawn_terminal to use cwd by default Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Fix tests and lints Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Fix formatting * feat(cwd-pane): Refactor child pid fetching to handle errors better Instead of panicking when transfering the process id of the forked child command we just return an empty process id. * feat(cwd-pane): Add non Linux/MacOS targets for the get_cwd method. This will allow Zellij to compile on non Linux/MacOS targets without having an inherited cwd. * feat(cwd-pane): Refactor spawn_terminal method to use ChildId struct. The spawn_terminal methods been refactored to use the ChildId struct in order to clarify what the Pid's returned by it are. The documentation for the ChildId struct was improved as well. * feat(cwd-pane): Fix tests/lints Co-authored-by: Jesse Tuchsen <not@disclosing> Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>
Diffstat (limited to 'zellij-server/src/unit/tab_tests.rs')
-rw-r--r--zellij-server/src/unit/tab_tests.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/zellij-server/src/unit/tab_tests.rs b/zellij-server/src/unit/tab_tests.rs
index ea96df627..de5c10670 100644
--- a/zellij-server/src/unit/tab_tests.rs
+++ b/zellij-server/src/unit/tab_tests.rs
@@ -1,11 +1,12 @@
use super::Tab;
use crate::zellij_tile::data::{ModeInfo, Palette};
use crate::{
- os_input_output::{AsyncReader, Pid, ServerOsApi},
+ os_input_output::{AsyncReader, ChildId, Pid, ServerOsApi},
panes::PaneId,
thread_bus::ThreadSenders,
SessionState,
};
+use std::path::PathBuf;
use std::sync::{Arc, RwLock};
use zellij_utils::input::layout::LayoutTemplate;
use zellij_utils::pane_size::Size;
@@ -27,7 +28,7 @@ impl ServerOsApi for FakeInputOutput {
fn set_terminal_size_using_fd(&self, _fd: RawFd, _cols: u16, _rows: u16) {
// noop
}
- fn spawn_terminal(&self, _file_to_open: Option<TerminalAction>) -> (RawFd, Pid) {
+ fn spawn_terminal(&self, _file_to_open: TerminalAction) -> (RawFd, ChildId) {
unimplemented!()
}
fn read_from_tty_stdout(&self, _fd: RawFd, _buf: &mut [u8]) -> Result<usize, nix::Error> {
@@ -72,6 +73,9 @@ impl ServerOsApi for FakeInputOutput {
fn load_palette(&self) -> Palette {
unimplemented!()
}
+ fn get_cwd(&self, _pid: Pid) -> Option<PathBuf> {
+ unimplemented!()
+ }
}
fn create_new_tab(size: Size) -> Tab {