bugGNU Screen - Bugs: bug #65653, [PATCH] Add an option to create...


bug #65653: [PATCH] Add an option to create new window in current foreground process's cwd

Submitter:  Hayato Hiramatsu <hayatosv>
Submitted:  Sun 28 Apr 2024 11:25:09 AM UTC
Category:  Feature Request Severity:  3 - Normal
Priority:  * 5 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Release:  None
Fixed Release:  None Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup

Sun 28 Apr 2024 11:25:09 AM UTC, original submission:  


I wrote a patch to add an option to create a new window in current foreground process's current working directory (cwd).
Please review it!

This options is very useful when you want to do other things in the same directory
after you already started a long-running process.  Or, when the process is taking longer than you thought.

Also useful when you are using programs which manage their cwds. (like ftp client or editors)

This patch adds an option "-C" to :screen command.
":screen -C" calls tcgetpgrp and reads /proc/PID/cwd to get cwd of current foreground process.

I tried to achieve this by other means but, it turned out screen's support is necessary:
- If I add PROMPT_COMMAND or create alias for cd command in shell to keep track of cwd,
  child processes can chdir to any directory.
  So, suspending foreground process to back to shell is not an option either.

- To get cwd of current foreground process /proc/PID/cwd can be used in Linux, but
  no existing commands including :exec can get pids.
  Because :exec creates new process with new pts, we cannot find out which process was in foreground just before :exec.

Thank you.

Hayato Hiramatsu <hayatosv>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #55987:  new_windows_in_cwd_v1.patch added by hayatosv (967B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by hayatosv (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-28 hayatosv Attached File- Added new_windows_in_cwd_v1.patch, #55987

    Back to the top

    Powered by Savane 3.13-12ab.
    Corresponding source code