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

Use /compat/linux/proc in SpawnNewInstance on FreeBSD #2162

Merged
merged 2 commits into from Mar 8, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Terminfo support for extended capabilities
- Allow mouse presses and beginning of mouse selection in padding
- Windows: Conpty backend could close immediately on startup in certain situations
- FreeBSD: SpawnNewInstance will now open new instances in the shell's current
working directory as long as linprocfs(5) is mounted on `/compat/linux/proc`

## Version 0.2.9

Expand Down
6 changes: 5 additions & 1 deletion src/event.rs
Expand Up @@ -172,7 +172,11 @@ impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> {

#[cfg(unix)]
let args = {
if let Ok(path) = fs::read_link(format!("/proc/{}/cwd", unsafe { tty::PID })) {
#[cfg(not(target_os = "freebsd"))]
let proc_prefix = "";
#[cfg(target_os = "freebsd")]
let proc_prefix = "/compat/linux";
if let Ok(path) = fs::read_link(format!("{}/proc/{}/cwd", proc_prefix, unsafe { tty::PID })) {
vec!["--working-directory".into(), path]
} else {
Vec::new()
Expand Down