Comments (5)
@krader1961: Wouldn't using \0 as the separator work as well? That way you could loop through history entries with while read -z
. At least I believe that char can't occur in the history.
from fish-shell.
The following comment is from issue #3224 that I opened because I didn't find this issue when I did a superficial search.
The history --delete command is broken. If your history contains multiline commands each line is listed as an individual entry you can select for deletion. That's obviously bogus. It might be possible to fix that. However, I'm wondering if it wouldn't make more sense to simply change the UI to eliminate selecting individual entries for deletion. Just give the user the choice of deleting all or none of the matching entries.
Also, including the recently introduced -t or --with-time flag produces output that makes selecting an individual entry for deletion impossible. Yet another reason to remove that capability.
I noticed this while working on issue #3224.
from fish-shell.
Running into this same bug when a command is in a begin/end block spanning multiple lines. I would expect slightly different behaviour to what @ridiculousfish talks about in the original report.
for example, if my history contains
begin
echo hello
echo world
end
history --prefix echo should return no results (as it does currently)
history --prefix begin should return (as it does currently)
begin
echo hello
echo world
end
(although it would possibly be even nicer if it indented output in the same way writing "begin[return]" at the interactive prompt does)
history --prefix begin --delete should allow me to delete the entire block (it currently does not)
history --contains echo --delete should also allow me to delete the entire block (it currently does not)
I don't think it would be consistent if "history --contains echo --delete" deleted only the lines in the block that contained echo, because then in the example above you'd be left with
begin
end
in your history and it wouldn't make sense.
from fish-shell.
It seems like the only sensible solution is adding another flag to request that the history search
output have newlines converted to \n
and backslashes escaped (i.e., \
-> \\
). Similar to, if not identical to, running each history item through string escape --no-quoted
before writing it to stdout. The caller can then easily and safely unescape the search output back to its original form for display and other processing. Even if --with-time
or -t
was also used.
It is unlikely this will be implemented in time for the 2.4.0 release but I'm going to focus on fixing this any way. Fixing this will make a nice finale to the other history improvements that have been made in the past couple of months.
from fish-shell.
Wouldn't using \0 as the separator work as well?
Yes. I was worried about potentially having an embedded NUL in the history but that's impossible today and we should prohibit it in the future if we ever switch from "char *" style strings to C++ string objects in all the history code paths.
from fish-shell.
Related Issues (20)
- Multiple successive up-or-search broken in gnome terminal HOT 3
- Autosuggestions suggest non-existing files HOT 5
- mipsel arch lacks AtomicU64 support HOT 5
- Suppress wildcards-globbing for http(s) parameters HOT 1
- Can't use Windows Terminal's Starting Directory HOT 4
- document limitations of --condition HOT 4
- Request to add support for piping into `fish -c 'builtin'` for built-ins HOT 3
- Inconsistanc behavior when changing a symlinked folder in the current working directory HOT 1
- [Suggestion] Do not include final slash on path completion for symlinks to directories HOT 2
- `commandline` seems to lose line break characters HOT 2
- consider making `history-prefix-search-backward` and forward don't change cursor position HOT 1
- [Feature] [vi-mode] Support command count HOT 2
- cd fails for directory without read permission, displays `Permission denied` HOT 3
- `history merge` has mmap issues with certain remote filesystems HOT 8
- WARNING: 'envvar' reference target not found when running 'sphinx-build' to build docs HOT 3
- Using `read` in script cause panic
- Parse and even freeze issue on pasting large input HOT 2
- Error with scp completion HOT 6
- How to have completions for a command match that of an empty command line? HOT 2
- A strange escape sequence "^[[O"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fish-shell.