Preserve tcsh history in multiple terminal windowsPreserve bash history in multiple terminal windowsPreserve...
How would an order of Monks that renounce their names communicate effectively?
How do I tell the reader that my character is autistic in Fantasy?
How exactly is a normal force exerted, at the molecular level?
What exactly did Ant-Man see that made him say that their plan worked?
Was it really unprofessional of me to leave without asking for a raise first?
Meaning of じゃないんじゃない?
Who voices the character "Finger" in The Fifth Element?
Movie in a trailer park named Paradise and a boy playing a video game then being recruited by aliens to fight in space
Graph problems as integer programs
How to describe POV characters?
I'm reinstalling my Linux desktop, how do I keep SSH logins working?
Is there a legal way for US presidents to extend their terms beyond four years?
Which is better for keeping data primary partition or logical partition?
Do launching rockets produce a sonic boom?
Company threatening to call my current job after I declined their offer
How to answer "write something on the board"?
Are gliders susceptible to bird strikes?
In native German words, is Q always followed by U, as in English?
I hit a pipe with a mower and now it won't turn
Can a function nowhere continuous have a connected graph?
My colleague is constantly blaming me for his errors
Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?
Why won't the ground take my seed?
How can a valley surrounded by mountains be fertile and rainy?
Preserve tcsh history in multiple terminal windows
Preserve bash history in multiple terminal windowsPreserve bash history in multiple terminal windowsTrouble adding date to tcsh historyHow do I set an unlimited size to the history file for tcsh?How to preserve bash history in multiple terminal windowsWhat do you use to manage your shell history?Is there a way to make the history when pressing up in bash shared between shells?How to sync terminal session command history in bash?bash history truncated to 2000 at new login after upgrade to ubuntu 16.04Hitting up-arrow does not cycle through historytcsh multiline prompt/rprompt
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
How can we preserve or maintain the same history across multiple terminals?
The same question, but for bash shell , were discussed in the below link
Preserve bash history in multiple terminal windows
let me know the corresponding settings for tcsh shell ?
command-history tcsh
add a comment |
How can we preserve or maintain the same history across multiple terminals?
The same question, but for bash shell , were discussed in the below link
Preserve bash history in multiple terminal windows
let me know the corresponding settings for tcsh shell ?
command-history tcsh
For more information on tcsh'shistory
, seeman tcsh
. Searching forhistory -S
should jump you to the most relevant part.
– Randall
Dec 28 '17 at 21:05
add a comment |
How can we preserve or maintain the same history across multiple terminals?
The same question, but for bash shell , were discussed in the below link
Preserve bash history in multiple terminal windows
let me know the corresponding settings for tcsh shell ?
command-history tcsh
How can we preserve or maintain the same history across multiple terminals?
The same question, but for bash shell , were discussed in the below link
Preserve bash history in multiple terminal windows
let me know the corresponding settings for tcsh shell ?
command-history tcsh
command-history tcsh
edited Apr 13 '17 at 12:36
Community♦
1
1
asked Aug 30 '13 at 9:34
user1228191user1228191
3211 gold badge5 silver badges10 bronze badges
3211 gold badge5 silver badges10 bronze badges
For more information on tcsh'shistory
, seeman tcsh
. Searching forhistory -S
should jump you to the most relevant part.
– Randall
Dec 28 '17 at 21:05
add a comment |
For more information on tcsh'shistory
, seeman tcsh
. Searching forhistory -S
should jump you to the most relevant part.
– Randall
Dec 28 '17 at 21:05
For more information on tcsh's
history
, see man tcsh
. Searching for history -S
should jump you to the most relevant part.– Randall
Dec 28 '17 at 21:05
For more information on tcsh's
history
, see man tcsh
. Searching for history -S
should jump you to the most relevant part.– Randall
Dec 28 '17 at 21:05
add a comment |
2 Answers
2
active
oldest
votes
These variables set the history to merge itself instead of overwrite, and not save duplicates:
set history=1000
set histdup=erase
set savehist=(1000 merge)
the secret sauce is this line:
alias precmd 'history -S; history -M'
which will save and merge your history prior to printing the prompt - i.e. after each command you type.
all of the above should be added to your .tcshrc file.
When I added thisalias precmd 'history -S; history -M'
nothing occurred when I wrote any command. Is there something else that should be done?
– Ayman Salah
Mar 14 '17 at 11:53
@AymanSalah what occurs is not obvious - it's the.history
file (orhistfile
shell variable value, if set) getting written to disk. Without theprecmd
alias set,ls -l .history
will show the.history
file as a untouched. Withprecmd
set as above,ls -l .history
will show the updated timestamp and size, as it gets written with each command.
– Randall
Dec 28 '17 at 20:21
@Randall Thank you for pointing that out. I had problems then with the shell session. What you're saying is 100% correct.
– Ayman Salah
Jan 1 '18 at 9:53
add a comment |
In addition to Idan answer, I want to add that alias precmd 'history -S; history -M'
potentially can mess up the history file, since it also records SIGINT and EOF signal (Ctrl+C and Ctrl+D).
A better way would be save and merge current shell history before running a command, and save after a comment.
You can achieve it by this setup below instead, because the tcsh doesn't recognize SIGINT or EOF as a command.
alias precmd "history -M"
alias postcmd "history -S"
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f88838%2fpreserve-tcsh-history-in-multiple-terminal-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
These variables set the history to merge itself instead of overwrite, and not save duplicates:
set history=1000
set histdup=erase
set savehist=(1000 merge)
the secret sauce is this line:
alias precmd 'history -S; history -M'
which will save and merge your history prior to printing the prompt - i.e. after each command you type.
all of the above should be added to your .tcshrc file.
When I added thisalias precmd 'history -S; history -M'
nothing occurred when I wrote any command. Is there something else that should be done?
– Ayman Salah
Mar 14 '17 at 11:53
@AymanSalah what occurs is not obvious - it's the.history
file (orhistfile
shell variable value, if set) getting written to disk. Without theprecmd
alias set,ls -l .history
will show the.history
file as a untouched. Withprecmd
set as above,ls -l .history
will show the updated timestamp and size, as it gets written with each command.
– Randall
Dec 28 '17 at 20:21
@Randall Thank you for pointing that out. I had problems then with the shell session. What you're saying is 100% correct.
– Ayman Salah
Jan 1 '18 at 9:53
add a comment |
These variables set the history to merge itself instead of overwrite, and not save duplicates:
set history=1000
set histdup=erase
set savehist=(1000 merge)
the secret sauce is this line:
alias precmd 'history -S; history -M'
which will save and merge your history prior to printing the prompt - i.e. after each command you type.
all of the above should be added to your .tcshrc file.
When I added thisalias precmd 'history -S; history -M'
nothing occurred when I wrote any command. Is there something else that should be done?
– Ayman Salah
Mar 14 '17 at 11:53
@AymanSalah what occurs is not obvious - it's the.history
file (orhistfile
shell variable value, if set) getting written to disk. Without theprecmd
alias set,ls -l .history
will show the.history
file as a untouched. Withprecmd
set as above,ls -l .history
will show the updated timestamp and size, as it gets written with each command.
– Randall
Dec 28 '17 at 20:21
@Randall Thank you for pointing that out. I had problems then with the shell session. What you're saying is 100% correct.
– Ayman Salah
Jan 1 '18 at 9:53
add a comment |
These variables set the history to merge itself instead of overwrite, and not save duplicates:
set history=1000
set histdup=erase
set savehist=(1000 merge)
the secret sauce is this line:
alias precmd 'history -S; history -M'
which will save and merge your history prior to printing the prompt - i.e. after each command you type.
all of the above should be added to your .tcshrc file.
These variables set the history to merge itself instead of overwrite, and not save duplicates:
set history=1000
set histdup=erase
set savehist=(1000 merge)
the secret sauce is this line:
alias precmd 'history -S; history -M'
which will save and merge your history prior to printing the prompt - i.e. after each command you type.
all of the above should be added to your .tcshrc file.
answered Apr 29 '15 at 5:02
IdanIdan
861 silver badge2 bronze badges
861 silver badge2 bronze badges
When I added thisalias precmd 'history -S; history -M'
nothing occurred when I wrote any command. Is there something else that should be done?
– Ayman Salah
Mar 14 '17 at 11:53
@AymanSalah what occurs is not obvious - it's the.history
file (orhistfile
shell variable value, if set) getting written to disk. Without theprecmd
alias set,ls -l .history
will show the.history
file as a untouched. Withprecmd
set as above,ls -l .history
will show the updated timestamp and size, as it gets written with each command.
– Randall
Dec 28 '17 at 20:21
@Randall Thank you for pointing that out. I had problems then with the shell session. What you're saying is 100% correct.
– Ayman Salah
Jan 1 '18 at 9:53
add a comment |
When I added thisalias precmd 'history -S; history -M'
nothing occurred when I wrote any command. Is there something else that should be done?
– Ayman Salah
Mar 14 '17 at 11:53
@AymanSalah what occurs is not obvious - it's the.history
file (orhistfile
shell variable value, if set) getting written to disk. Without theprecmd
alias set,ls -l .history
will show the.history
file as a untouched. Withprecmd
set as above,ls -l .history
will show the updated timestamp and size, as it gets written with each command.
– Randall
Dec 28 '17 at 20:21
@Randall Thank you for pointing that out. I had problems then with the shell session. What you're saying is 100% correct.
– Ayman Salah
Jan 1 '18 at 9:53
When I added this
alias precmd 'history -S; history -M'
nothing occurred when I wrote any command. Is there something else that should be done?– Ayman Salah
Mar 14 '17 at 11:53
When I added this
alias precmd 'history -S; history -M'
nothing occurred when I wrote any command. Is there something else that should be done?– Ayman Salah
Mar 14 '17 at 11:53
@AymanSalah what occurs is not obvious - it's the
.history
file (or histfile
shell variable value, if set) getting written to disk. Without the precmd
alias set, ls -l .history
will show the .history
file as a untouched. With precmd
set as above, ls -l .history
will show the updated timestamp and size, as it gets written with each command.– Randall
Dec 28 '17 at 20:21
@AymanSalah what occurs is not obvious - it's the
.history
file (or histfile
shell variable value, if set) getting written to disk. Without the precmd
alias set, ls -l .history
will show the .history
file as a untouched. With precmd
set as above, ls -l .history
will show the updated timestamp and size, as it gets written with each command.– Randall
Dec 28 '17 at 20:21
@Randall Thank you for pointing that out. I had problems then with the shell session. What you're saying is 100% correct.
– Ayman Salah
Jan 1 '18 at 9:53
@Randall Thank you for pointing that out. I had problems then with the shell session. What you're saying is 100% correct.
– Ayman Salah
Jan 1 '18 at 9:53
add a comment |
In addition to Idan answer, I want to add that alias precmd 'history -S; history -M'
potentially can mess up the history file, since it also records SIGINT and EOF signal (Ctrl+C and Ctrl+D).
A better way would be save and merge current shell history before running a command, and save after a comment.
You can achieve it by this setup below instead, because the tcsh doesn't recognize SIGINT or EOF as a command.
alias precmd "history -M"
alias postcmd "history -S"
New contributor
add a comment |
In addition to Idan answer, I want to add that alias precmd 'history -S; history -M'
potentially can mess up the history file, since it also records SIGINT and EOF signal (Ctrl+C and Ctrl+D).
A better way would be save and merge current shell history before running a command, and save after a comment.
You can achieve it by this setup below instead, because the tcsh doesn't recognize SIGINT or EOF as a command.
alias precmd "history -M"
alias postcmd "history -S"
New contributor
add a comment |
In addition to Idan answer, I want to add that alias precmd 'history -S; history -M'
potentially can mess up the history file, since it also records SIGINT and EOF signal (Ctrl+C and Ctrl+D).
A better way would be save and merge current shell history before running a command, and save after a comment.
You can achieve it by this setup below instead, because the tcsh doesn't recognize SIGINT or EOF as a command.
alias precmd "history -M"
alias postcmd "history -S"
New contributor
In addition to Idan answer, I want to add that alias precmd 'history -S; history -M'
potentially can mess up the history file, since it also records SIGINT and EOF signal (Ctrl+C and Ctrl+D).
A better way would be save and merge current shell history before running a command, and save after a comment.
You can achieve it by this setup below instead, because the tcsh doesn't recognize SIGINT or EOF as a command.
alias precmd "history -M"
alias postcmd "history -S"
New contributor
New contributor
answered 1 hour ago
berong91berong91
11 bronze badge
11 bronze badge
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f88838%2fpreserve-tcsh-history-in-multiple-terminal-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
For more information on tcsh's
history
, seeman tcsh
. Searching forhistory -S
should jump you to the most relevant part.– Randall
Dec 28 '17 at 21:05