[MacPorts] #56381: It would be nice if shell mode saved command history immediately

MacPorts noreply at macports.org
Wed May 2 18:29:05 UTC 2018


#56381: It would be nice if shell mode saved command history immediately
----------------------------+--------------------
  Reporter:  ylluminarious  |      Owner:  (none)
      Type:  enhancement    |     Status:  new
  Priority:  Normal         |  Milestone:
 Component:  base           |    Version:  2.4.3
Resolution:                 |   Keywords:
      Port:                 |
----------------------------+--------------------

Comment (by ylluminarious):

 Replying to [comment:3 raimue]:
 > Hello, and welcome to MacPorts! Yes, you already found the right place
 with `process_command_file` in the port client.
 >
 > I guess the solution would be to call `rl_history write` ''before''
 executing the command. Then it would always be saved, even if the command
 itself is interrupted. Could even be done in `get_next_cmdline` where the
 line is added to the readline history in memory.
 >
 > One drawback is that this would always write the full history file
 instead of just appending a single line. It looks like readline (actually
 libedit) has a `append_history` function we are not yet wrapping in
 [https://github.com/macports/macports-
 base/blob/8dda587a7359d8aa71fea3ad9744ba7019dcd1f2/src/pextlib1.0/readline.c#L263-L334
 rl_history] that should be used for appends.
 >
 > Let us know if you get stuck or need assistance when working on this!

 Hi! Thanks so much for your advice. Those are certainly some good pointers
 and I'm sure it will help me out as I'm implementing this.

 Honestly, I've begun to use Macports out of some disenfranchisement with
 Homebrew. That project is more and more taking away features and
 estranging certain kinds of users with certain use-cases. It seems that
 this is largely due to the maintainers'
 [https://mikemcquaid.com/2018/03/19/open-source-maintainers-owe-you-
 nothing/ open and flagrant disregard for users.] I am glad that it seems
 that the Macports project is more welcoming to improvements.

-- 
Ticket URL: <https://trac.macports.org/ticket/56381#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list