mridgers / clink

Bash's powerful command line editing in cmd.exe
mridgers.github.io/clink
GNU General Public License v3.0
3.2k stars 283 forks source link

Command history missing in .history... #512

Open BDein opened 5 years ago

BDein commented 5 years ago

Hi great Folks,

A couple of technical questions:

Current history is missing in history file, but arrow-up and down works fine, but I can't search the history, which is a big problem. I know exit and restart puts history to the file, but that's not a smart way. What is the smart way? How does the history work? 2.1 ie. which role does doskey play? How do I force the keyboard buffer history to be saved to the history file (on demand)? 3.1. Is the a connection to doskey macro: "save=DOSKEY /history $g$g "\cmd_history.log" 3.1.1. If so, how do I use this, as it doesn't work out of the box?

garoto commented 5 years ago
> clink set history_io
         Name: history_io
  Description: Read/write history file each line edited
Current value: 1

When non-zero the history will be read from disk before editing a new line and
written to disk afterwards.

> clink set history_io 1
Settings 'history_io' set to '1'
daxgames commented 5 years ago

@garoto @BDein

This no longer works in alpha versions see #520

garoto commented 5 years ago

Have you tried clink set history.shared and setting it to 1? Also, clink set to list all the new/renamed options and clink set <option> for a small blurb of what it does.

raghur commented 4 years ago

history.shared doesn't seem to affect the issue... commands aren't added to history until process exist AFAICT

EDIT I'll take that back - setting history.shared to 1 does seem to get a single history but the behavior is sort of unpredictable - there seems to be some sort of non-deterministic delay on when commands typed in one terminal show up in the history of another terminal and it's long enough to be easy to run into and irritating :(

chrisant996 commented 4 years ago

In the chrisant996 fork history seems to be working for shared=0 and shared=1.

History load/save is this: