zsh-users
 help / color / mirror / code / Atom feed
* Fw: Zsh - push current command on history without executing it
@ 2008-01-04 10:59 Peter Stephenson
  2008-01-04 11:04 ` Mikael Magnusson
  0 siblings, 1 reply; 51+ messages in thread
From: Peter Stephenson @ 2008-01-04 10:59 UTC (permalink / raw)
  To: Zsh Users

Forwarded from someone presumably not on the list.


Begin forwarded message:

Date: Mon, 24 Dec 2007 03:59:55 +0200
From: Casper Gripenberg <casper.gripenberg@kotiportti.fi>
To: pws@zsh.org
Subject: Zsh - push current command on history without executing it



Hi..I was reading the zsh manual and trying to
figure out how to push the current command line
into the history list wihout actually executing
the command.

push-line does almost what I want, but it pops
the command back into view after I issue the next
command. What I'm looking for is something like
push-history..  but I can't find it. Is there
such a thing or any way to make zsh do something
like that?

Thanks.

Casper


^ permalink raw reply	[flat|nested] 51+ messages in thread
* Re: idea for new feature (was: Re: sticky-note and zle bindings)
@ 2008-01-24 18:17 Robert Knight
  2008-01-24 20:09 ` Richard Hartmann
  2008-01-25  5:58 ` Bart Schaefer
  0 siblings, 2 replies; 51+ messages in thread
From: Robert Knight @ 2008-01-24 18:17 UTC (permalink / raw)
  To: zsh-users

Hi,

> It works with gnome-terminal, with konsole it doesn't.
> But konsole must have some kind of state management because
> my wife's KDE Desktop restores all shells including the PWD.

Konsole/KDE 3 reads the shell's current working directory from /proc
and saves that information.  When logging in again it opens each
window / tab with the same binary and with the working directory
recorded from /proc at shutdown.  This is a pretty poor solution since
information about the shell's variables (local and environment),
history, prompt etc. are not kept.

Please don't try to do window state setup from the shell.  There are a
number of reasons for this:

- gnome-terminal and Konsole both support tabs and a variety of other
window state features which cannot be controlled using escape codes
- KDE already has good built-in facilities for handling window state
between sessions, it can do a better job than zsh.  This includes
cases where windows are spread across multiple displays.
- Konsole supports additional properties for each terminal such as
color scheme, key binding, scrollback settings and font setup which
only it has access to.

In summary, the shell should remember information which it knows best
(prompt,variables,history etc.) and the terminal should keep the
information which it knows best.

I think the SHELL_SESSION_COOKIE suggestion (perhaps
SHELL_SESSION_ID?) would be best from my point of view as a Konsole
developer.  The value should be a unique ID of a known format so that
terminals don't end up generating pre-existing IDs by mistake.
The only problem with this approach is that there needs to be a way
for a particular session to be ended.  Some options:

* End a session when an explicit command is sent to it (eg. 'Ctrl+D' or 'exit')
* Don't end sessions.  Instead keep data around for the last X
sessions (where X might be 5,10 or 20).
* Define a new escape code to end a session.

Regards,
Robert.


^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2008-06-27 16:26 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-04 10:59 Fw: Zsh - push current command on history without executing it Peter Stephenson
2008-01-04 11:04 ` Mikael Magnusson
2008-01-04 11:24   ` Casper Gripenberg
2008-01-09 18:58     ` zzapper
2008-01-09 19:15       ` Paul Lew
2008-01-13  8:00       ` Bart Schaefer
2008-01-15 22:57         ` sticky-notes script [was: Zsh - push current command on history without executing it] Jean-Rene David
2008-01-16  8:06           ` Bart Schaefer
2008-01-16 13:10         ` sticky-note and zle bindings Andy Spiegl
2008-01-16 15:59           ` Bart Schaefer
2008-01-16 17:12             ` idea for new feature (was: Re: sticky-note and zle bindings) Andy Spiegl
2008-01-17  3:11               ` Bart Schaefer
2008-01-17 17:26                 ` Andy Spiegl
2008-01-18  2:12                   ` Christopher Lord
2008-01-18  9:19                   ` Bart Schaefer
2008-01-19 22:24                     ` Andy Spiegl
2008-01-20  0:01                       ` Bart Schaefer
2008-01-20  4:36                         ` Matt Wozniski
2008-01-20  9:09                           ` Bart Schaefer
2008-01-18 21:21                 ` Richard Hartmann
2008-01-19 21:46                   ` Andy Spiegl
2008-01-19 23:05                     ` Bart Schaefer
2008-01-24 18:17 Robert Knight
2008-01-24 20:09 ` Richard Hartmann
2008-01-24 20:54   ` Richard Hartmann
2008-01-24 21:54     ` Robert Knight
2008-01-24 23:22       ` Richard Hartmann
     [not found]         ` <13ed09c00801241857n2b1613f0m2d74fd12a90135cc@mail.gmail.com>
2008-01-25  9:32           ` Richard Hartmann
2008-01-25 17:57             ` Bart Schaefer
2008-01-25 18:18               ` Robert Knight
2008-01-26  2:12                 ` Bart Schaefer
2008-01-26 15:41                   ` Richard Hartmann
2008-01-26 23:31                     ` Bart Schaefer
2008-01-28 16:33                       ` Andy Spiegl
2008-06-07  4:39                         ` Robert Knight
2008-06-10  4:13                           ` Benjamin R. Haskell
2008-06-11  0:02                             ` Richard Hartmann
2008-06-11  0:26                               ` Benjamin R. Haskell
2008-06-11  1:17                                 ` Richard Hartmann
2008-06-11  4:43                                 ` Bart Schaefer
2008-06-11  4:51                                   ` Benjamin R. Haskell
2008-06-11 11:47                                 ` Angel Olivera
2008-06-10 23:57                           ` Richard Hartmann
2008-06-20 12:06                           ` Richard Hartmann
2008-06-27 16:25                             ` Richard Hartmann
2008-01-26 15:19               ` Richard Hartmann
2008-01-26 15:26                 ` Clint Adams
2008-01-26 15:42                   ` Richard Hartmann
2008-01-26 15:43                   ` Richard Hartmann
2008-01-25  5:58 ` Bart Schaefer
2008-01-25  9:49   ` Richard Hartmann
2008-01-25 20:10     ` Bastian, Waldo
2008-01-26 15:29       ` Richard Hartmann

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).