Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command history missing in .history... #512

Open
BDein opened this issue Feb 3, 2019 · 5 comments
Open

Command history missing in .history... #512

BDein opened this issue Feb 3, 2019 · 5 comments

Comments

@BDein
Copy link

BDein commented Feb 3, 2019

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
Copy link

garoto commented Feb 4, 2019

> 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
Copy link

@garoto @BDein

This no longer works in alpha versions see #520

@garoto
Copy link

garoto commented Jun 16, 2019

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
Copy link

raghur commented Oct 16, 2019

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
Copy link

chrisant996 commented Sep 23, 2020

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

History load/save is this:

  • History is loaded from disk each time the editor becomes active (this picks up any changes to the history made by other cmd sessions).
  • When shared, history is flushed to disk and appended to the global history each time the editor ends (e.g. pressing Enter).
  • When not shared, history is flushed to disk and appended to the global history when the cmd session ends (e.g. "exit").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
-