Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Mar 2019 12:29:37 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r496561 - in head/x11/alacritty: . files
Message-ID:  <201903221229.x2MCTbKq091711@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Fri Mar 22 12:29:37 2019
New Revision: 496561
URL: https://svnweb.freebsd.org/changeset/ports/496561

Log:
  x11/alacritty: Apply workaround to let SpawnNewInstance work on FreeBSD
  
  On Linux Alacritty looks up /proc/$shell_pid/cwd to open new instances
  in the same working directory as the old instance which does not
  work with FreeBSD's procfs(5).  As a workaround we can for now
  fallback to linprocfs(5), often mounted on /compat/linux/proc, until
  there is support for KERN_PROC_CWD and struct kinfo_file in the
  Rust ecosystem (libc or elsewhere).
  
  PR:		236382
  Submitted by:	tobik
  Approved by:	zeising (maintainer timeout, 2 weeks)

Added:
  head/x11/alacritty/files/
  head/x11/alacritty/files/patch-src_event.rs   (contents, props changed)
Modified:
  head/x11/alacritty/Makefile

Modified: head/x11/alacritty/Makefile
==============================================================================
--- head/x11/alacritty/Makefile	Fri Mar 22 12:10:37 2019	(r496560)
+++ head/x11/alacritty/Makefile	Fri Mar 22 12:29:37 2019	(r496561)
@@ -3,7 +3,7 @@
 PORTNAME=	alacritty
 PORTVERSION=	0.2.9
 DISTVERSIONPREFIX=	v
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	x11
 
 MAINTAINER=	zeising@FreeBSD.org

Added: head/x11/alacritty/files/patch-src_event.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/alacritty/files/patch-src_event.rs	Fri Mar 22 12:29:37 2019	(r496561)
@@ -0,0 +1,20 @@
+Let Alacritty open new instances in the shell's working directory
+as long as linprocfs(5) is mounted on /compat/linux/proc.
+
+https://github.com/jwilm/alacritty/commit/0ec4bd28dadcf476baf6180af7cf93bea9214f19
+
+--- src/event.rs.orig	2019-02-11 23:59:21 UTC
++++ src/event.rs
+@@ -172,7 +172,11 @@ impl<'a, N: Notify + 'a> input::ActionContext for Acti
+ 
+         #[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()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903221229.x2MCTbKq091711>