screen-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[screen-devel] [bug #65653] [PATCH] Add an option to create new window i


From: Hayato Hiramatsu
Subject: [screen-devel] [bug #65653] [PATCH] Add an option to create new window in current foreground process's cwd
Date: Sun, 28 Apr 2024 07:25:10 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?65653>

                 Summary: [PATCH] Add an option to create new window in
current foreground process's cwd
                   Group: GNU Screen
               Submitter: hayatosv
               Submitted: Sun 28 Apr 2024 08:25:09 PM JST
                Category: Feature Request
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
                 Release: None
         Discussion Lock: Any
           Fixed Release: None
         Planned Release: None
           Work Required: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sun 28 Apr 2024 08:25:09 PM JST By: Hayato Hiramatsu <hayatosv>
Hello,

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.






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Name: new_windows_in_cwd_v1.patch  Size: 967B
<https://file.savannah.gnu.org/file/new_windows_in_cwd_v1.patch?file_id=55987>

    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://git.savannah.nongnu.org/cgit/administration/savane.git/snapshot/savane-02a92bc3de37203138822bd2520e89ef55345685.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65653>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]