Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support current path in Windows #440

Open
raphamorim opened this issue Jan 29, 2024 · 0 comments
Open

Support current path in Windows #440

raphamorim opened this issue Jan 29, 2024 · 0 comments
Labels

Comments

@raphamorim
Copy link
Owner

Teletypewriter should be able to retrieve current path on windows as well

            #[cfg(not(target_os = "windows"))]
            {
                if let Ok(path) = teletypewriter::foreground_process_path(
                    *current_context.main_fd,
                    current_context.shell_pid,
                ) {
                    working_dir = Some(path.to_string_lossy().to_string());
                }
            }

            #[cfg(target_os = "windows")]
            {
                // if let Ok(path) = teletypewriter::foreground_process_path() {
                //     working_dir =
                //         Some(path.to_string_lossy().to_string());
                // }
                working_dir = None;
            }
        }

#[cfg(not(target_os = "windows"))]
{
if let Ok(path) = teletypewriter::foreground_process_path(
*current_context.main_fd,
current_context.shell_pid,
) {
working_dir = Some(path.to_string_lossy().to_string());
}
}
#[cfg(target_os = "windows")]
{
// if let Ok(path) = teletypewriter::foreground_process_path() {
// working_dir =
// Some(path.to_string_lossy().to_string());
// }
working_dir = None;
}
}

@raphamorim raphamorim added good first issue Good for newcomers windows labels Jan 29, 2024
@raphamorim raphamorim removed the good first issue Good for newcomers label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

1 participant