cantino / mcfly Goto Github PK
View Code? Open in Web Editor NEWFly through your shell history. Great Scott!
License: MIT License
Fly through your shell history. Great Scott!
License: MIT License
Right now search is done in a case-insensitive way, but in found commands matched fragments are highlighted in respect for case. In this situation it becomes hard to spot in a command why it was found at all.
I'm proposing to use approach from PhpStorm IDE: highlight what's being searched for. As for implementation:
This has been in my .bashrc for many years:
export HISTSIZE=100000
export HISTTIMEFORMAT=': %Y-%m-%d_%H:%M:%S; '
export HISTIGNORE="&:ls:ll:[bf]g:w:who:exit:history"
export HISTCONTROL="ignoreboth"
I'm looking at swapping in mcfly. Do I need to modify these in any way? Does mcfly's database honor HISTSIZE or does it store/remember forever?
I'm working with multiple bash shells and ran in the following error while I ran 3 commands in different shells:
thread 'main' panicked at 'McFly error: Unable to create schema_versions db table: SqliteFailure(Error { code: DatabaseBusy, extended_code: 5 }, Some("database is locked"))', src/libcore/result.rs:1009:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
I'm using McFly version 0.3.3.
Eg: c995dc2
Seems like some out of tree trained / compiled network... Or can we generate these ourselves??
I've tweaked my bash history to have a timestamp in .bash_history
, following this blog post https://sanctum.geek.nz/arabesque/better-bash-history/
After installing mcfly, commands get appended in $HISTFILE file without timestamp.
I think mcfly add --exit ${exit_code} --append-to-histfile
(in mcfly.bash
) should handle this variable and write history according to its value.
Hi,
I started to get those messages whenever I open a new terminal:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
I can confirm they are coming from McFly because they disappear as soon as I remove the integration in my profile. Ie if I comment out this:
if [[ -f "$(brew --prefix)/opt/mcfly/mcfly.bash" ]]; then
source "$(brew --prefix)/opt/mcfly/mcfly.bash"
fi
Sadly, the backtrace is not helpful:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:1009:5
stack backtrace:
0: <unknown>
1: <unknown>
2: <unknown>
3: <unknown>
4: <unknown>
5: <unknown>
6: <unknown>
7: <unknown>
8: <unknown>
9: <unknown>
I'm not 100% sure why/when it started. I'm guessing something changed on my machine but I'm not quite sure what. I upgraded to Mojave a couple weeks back but this only started a couple days ago. Aside from the message, everything else still works fine: I can use McFly and it records my commands properly.
Ideas?
Thanks!
McFly: Importing Bash history for the first time. This may take a minute or two...
This is misleading. My .bash_history is about 5MB big and I keep seeing this message for at least 15 minutes on a quad core CPU. Another ugly side effect that no terminal windows can be spawned meanwhile - they stay locked (the workaround is simple, use a shell in a terminal that was already started before enabling mcfly, but this can be a problem if there's none). Perhaps you need to add some import progress like "x out of y lines from .bash_history are imported"?
I happened to have created a directory a while back that is invalid in any encoding scheme available in python, for testing. The mkdir
and cd
are then in my bash history file, and contain invalid unicode. I was able to reduce the reproducing example down to:
$ cat ~/.bash_history
cd �abc\\uXXXX/
$ xxd ~/.bash_history
00000000: 6364 2080 6162 635c 5c75 5858 5858 2f0a cd .abc\\uXXXX/.
which causes the following crash:
thread 'main' panicked at '"/tmp/mcfly.HE5x" file not found: Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }', libcore/result.rs:1009:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::panicking::default_hook::{{closure}}
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
at libstd/panicking.rs:211
2: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:227
at libstd/panicking.rs:476
3: std::panicking::continue_panic_fmt
at libstd/panicking.rs:390
4: rust_begin_unwind
at libstd/panicking.rs:325
5: core::panicking::panic_fmt
at libcore/panicking.rs:77
6: core::result::unwrap_failed
7: mcfly::bash_history::full_history
8: mcfly::bash_history::last_history_line
9: mcfly::settings::Settings::parse_args
10: mcfly::main
11: std::rt::lang_start::{{closure}}
12: main
13: __libc_start_main
14: _start
I tried the following diff, and ran into further errors:
# git diff
diff --git a/src/bash_history.rs b/src/bash_history.rs
index dcbc34c..014deec 100644
--- a/src/bash_history.rs
+++ b/src/bash_history.rs
@@ -12,12 +12,12 @@ pub fn bash_history_file_path() -> PathBuf {
}
pub fn full_history(path: &PathBuf) -> Vec<String> {
- let bash_history_contents =
- fs::read_to_string(&path).expect(format!("{:?} file not found", &path).as_str());
+ let bash_history_contents = fs::read_to_string(&path).unwrap_or_default();
let timestamp_regex = Regex::new(r"\A#\d{10}").unwrap();
bash_history_contents
+ .as_str()
.split("\n")
.filter(|line| !timestamp_regex.is_match(line) && !line.is_empty())
.map(String::from)
After the above diff:
thread 'main' panicked at '"/tmp/mcfly.s88g" file not found: Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }', libcore/result.rs:1009:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::panicking::default_hook::{{closure}}
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
at libstd/panicking.rs:211
2: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:227
at libstd/panicking.rs:476
3: std::panicking::continue_panic_fmt
at libstd/panicking.rs:390
4: rust_begin_unwind
at libstd/panicking.rs:325
5: core::panicking::panic_fmt
at libcore/panicking.rs:77
6: core::result::unwrap_failed
7: mcfly::settings::Settings::parse_args
8: mcfly::main
9: std::rt::lang_start::{{closure}}
10: main
11: __libc_start_main
12: _start
Please see this discussion on sublime forum.
There's a screenshot and explanation.
This just happened, and seems undesirable. I moved a folder and McFly prints a pointless message.
gwk ~/work/pdfminer3/test master*%> $ mv crypto/ decrypt
McFly: Command database paths renamed from /Users/gwk/work/pdfminer3/test/crypto to /Users/gwk/work/pdfminer3/test/decrypt (affected 0 commands)
Once you learn it, it's simple: have mcfly in PATH and source the provided shell script. But a total beginner still may need to go back to the github repo to read the README after downloading the binary release. I suppose binary releases are often a choice for first time end users, since rust is still quite new and exotic / not available everywhere by default / not trivial to use to compile from source by someone who knows nothing about it. Having the README in the binary release tarball would make it self-sufficient.
Similarly to #22 I can open up the display, and choose my command, but in the end, all it tried to execute is mcfly search
, no matter what I type or select.
[~]
$ #mcfly:
[~]
$ mcfly search
[~]
$
$ cat /etc/issue.net
Ubuntu 18.04.1 LTS
There are many zsh users.
In Midnight Commander:
Have you checked that commands executed from Midnight Commander command line are tracked against proper directory?
This looks awesome, and admittedly this is more of a question than an issue per se. 😄
Any plans to add support for Fish shell?
When Terminal window can't fit all 10 results, then attempt to navigate into 6+ result just moves selection cursor out of the screen.
I'm proposing to implement clever scrolling, where search results are scrolled to fit inside visible Terminal window area.
McFly | ESC - Exit | ⏎ - Run | TAB - Edit | F2 - Delete
$
result1 <--- cursor here
result2
result3
result4
result5
result6
result7
result8
result9
result10
McFly | ESC - Exit | ⏎ - Run | TAB - Edit | F2 - Delete
$
result1 <--- cursor here
result2
result3
result4
result5
result6
McFly | ESC - Exit | ⏎ - Run | TAB - Edit | F2 - Delete
$
result2
result3
result4
result5
result6
result7 <--- cursor here
Real use case: Terminal
opened inside PhpStorm
.
@Lomanic wrote:
I'm trying McFly 0.3.3
(binary release x64 and manual install) on Debian 9 and I'm encountering the same error
McFly: Upgrading McFly DB to version 3, please wait...thread 'main' panicked at 'McFly error: Unable to add cmd_tpl to commands: SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("duplicate column name: cmd_tpl"))', src/libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Setting export RUST_BACKTRACE=1
adds the following backtrace
stack backtrace:
0: <unknown>
1: <unknown>
2: <unknown>
3: <unknown>
4: <unknown>
5: <unknown>
6: <unknown>
7: <unknown>
8: <unknown>
9: main
10: __libc_start_main
11: <unknown>
For me mcfly.bash
is properly sourced (MCFLY_SESSION_ID and MCFLY_HISTORY are set)
Here is the result of export RUST_BACKTRACE=1 && rm ~/.mcfly/history.db
McFly: Importing Bash history for the first time. This may take a minute or two...thread 'main' panicked at 'McFly error: Insert to work: NulError(NulError(0, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 49, 53, 51, 56, 56, 49, 51, 53, 49, 54]))', src/libcore/result.rs:1009:5
stack backtrace:
0: <unknown>
1: <unknown>
2: <unknown>
3: <unknown>
4: <unknown>
5: <unknown>
6: <unknown>
7: <unknown>
8: <unknown>
9: main
10: __libc_start_main
11: <unknown>
Unable to find all recent commands.
Some recently ran commands do not show up in mcfly
at all.
Also the list of suggested commands is quite short.
In my case it would also be useful to retrieve a command that was executed in a different working directory.
I am using a custom HISTFILE name. And to keep it that way, I also make this variable readonly.
As mcfly does
export HISTFILE="${HISTFILE:-$HOME/.bash_history}"
this leads to an annoying warning:
bash: HISTFILE: readonly variable
A check like
if [ -z "${HISTFILE}" ]; then
export HISTFILE="${HOME}/.bash_history"
fi
would prevent this warning for me.
Hi, Thanks for this nice software.
Quite often, I want to recall a command I typed a few minutes ago (e.g. "git commit ..."), but mcfly proposes some much more older matching commands.
I understand that it is due to its algorithm, but I'd like to force it to output the matches ordered by "recentness".
Is that possible ?
Otherwise would it be possible to add a shortcut that will reorder the matches by recentness ?
Karl
Homebrew is able to automatically enable completion for installed packages without need to add below code to ~/.bashrc
file:
if [[ -r "$(brew --prefix)/opt/mcfly/mcfly.bash" ]]; then
source "$(brew --prefix)/opt/mcfly/mcfly.bash"
fi
when you have this code in there already (you should have it since it's part of Homebrew installation process):
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Theoretically (I'm not creating Homebrew packages usually) adding below line to installation part of Homebrew Formula should do the trick:
bash_completion.install "mcfly.bash"
Maybe above line should replace prefix.install "mcfly.bash"
line.
I would like to be able to use Ctrl-j and Ctrl-k to move up and down, similar to the movement keys in FZF. Would this be possible?
Immediately after installation mcfly seemed to work as expected. Upon a reboot, however, pressing ctrl+r
gets me a mcfly session already prefilled with mcfly search
- if I type a space and then a search term, and press enter, I find myself in another mcfly session with my search results. (If I omit the space I get a complaint from mcfly about 'the subcommand 'search<term>' wasn't recognized', which seems reasonable).
I have a custom PROMPT_COMMAND
but nothing else noteworthy springs to mind.
Any ideas what might be interfering? I think I initially installed 0.2.3 (cleverly I deleted the tarfile after extracting it) and have upgraded to 0.2.4 with no change in behaviour.
Hi,
Please add "Usage" section to the readme file. And especially information about using '%' symbol as a way to use multiple searching patterns.
Thanks in advance
For example:
$ false
$ echo $?
This should print 1, but prints 0 when mcfly is loaded. This breaks custom bash prompts that e.g. set prompt color based on $?
.
Would it be possible to put mcfly on crates.io so that installation works with "cargo install"?
As a Linux user i don't even know what "brew" is ;)
I've downloaded mcfly-v0.3.1-x86_64-unknown-linux-gnu.tar.gz
binary from a latest release and when running mcfly
command I've got this error:
./mcfly: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./mcfly)
Doing ls -la /lib64/libc.so.6
command showed, that I have GLIBC_2.13:
lrwxrwxrwx 1 root root 12 Sep 21 2012 /lib64/libc.so.6 -> libc-2.13.so*
Would it be possible to also provide (in each release) Linux binary compiled against GLIBC 2.16?
P.S.
I was able to get McFly running by following manual compilation instructions, but was of course was a bit longer, then just using pre-compiled binary.
The tool looks great, and for users who don't use a history replacement tool already it looks like a no-brainer.
For those of us who already use one— how does mcfly compare to fzf, hstr, peco etc? What features would really make us want to jump ship?
As far as I understand:
.bash_history
file).bash_history
file are suggestedAt least it happens like this for me. Any idea why I'm experiencing such behavior?
I'm trying to build a package for Nixos, but when I source the macfly.bash file, it hangs on the following line:
Line 8 in a548e31
It's maybe due to the problem described in this forum. Cat is never stopped...
What seems to stop the command is using head -c 24
instead of the fold ... | head -n 1
:
[sam@Waluigi:~/projects/mcfly]$ x=$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c 24)
tr: write error: Broken pipe
tr: write error
cat: write error: Broken pipe
[sam@Waluigi:~/projects/mcfly]$ echo $x
ktgQD1V2qVWbvuLUnFTEhwGg
But then the broken pipe errors appear as you can see. I think they could be discarded with
x=$(cat /dev/urandom 2>/dev/null| env LC_ALL=C tr -dc 'a-zA-Z0-9' 2>/dev/null | head -c 24)
Hi,
Everything was working and suddenly i got:
Warning: Program '/bin/bash' crashed.
I tried reinstalling a new version v0.2.4 (downloading zip etc). But to no avail. I have also removed the history.db
and which also did not help.
My history settings:
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
export HISTFILE=~/.bash_eternal_history
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
When removing source "/home/me/opt/mcfly/mcfly.bash"
line from my .bashrc
bash works again.
Below is an error that is generated in journald when starting bash with myfly:
Dec 09 10:34:59 hprp audit[14797]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=14797 comm="bash" exe="/usr/bin/bash" sig=11 res=1
Dec 09 10:34:59 hprp systemd[1]: Started Process Core Dump (PID 15455/UID 0).
Dec 09 10:34:59 hprp audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@39-15455-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Dec 09 10:34:59 hprp systemd-coredump[15456]: Process 14797 (bash) of user 1000 dumped core.
Stack trace of thread 14797:
#0 0x000055c474b2161f _hs_append_history_line (bash)
#1 0x000055c474b24e13 read_history_range (bash)
#2 0x000055c474ae86bc history_builtin (bash)
#3 0x000055c474a97275 n/a (bash)
#4 0x000055c474a99e12 n/a (bash)
#5 0x000055c474a9b0d4 execute_command_internal (bash)
#6 0x000055c474a9bc63 execute_command_internal (bash)
#7 0x000055c474a9c9b6 execute_command (bash)
#8 0x000055c474a9bc30 execute_command_internal (bash)
#9 0x000055c474a9c9b6 execute_command (bash)
#10 0x000055c474a9bc30 execute_command_internal (bash)
#11 0x000055c474ae4cf4 parse_and_execute (bash)
#12 0x000055c474a9068a execute_variable_command (bash)
#13 0x000055c474a84109 parse_command (bash)
#14 0x000055c474a841d8 read_command (bash)
#15 0x000055c474a84460 reader_loop (bash)
#16 0x000055c474a82b69 main (bash)
#17 0x00007f2516aff413 __libc_start_main (libc.so.6)
#18 0x000055c474a8330e _start (bash)
Dec 09 10:34:59 hprp audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@39-15455-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? te
Thanks
Awesome!! Any plan on making it available for zsh?
When I press Ctrl+R
for the first time the last command is shown automatically. This is radically different comparing to approach default Ctrl+R
does, where no command is shown and I have to start typing.
Currently I have to delete suggested command first (one-by-one symbol) and start typing what I actually wanted to see.
Maybe instead it's possible to show list of suggested commands below and by pressing Down arrow
people then can manually confirm, that they want 1st suggested entry to be used.
Right now I don't have a choice really.
Hi!
Thanks for a nice tool :)
Would you consider adding Ctrl-n
and Ctrl-p
bindings, because this behaviour is present in Bash's Ctrl-r
?
This request may overlap with #16
Thanks.
I have setup 2 line bash prompt, that looks like this (not sure if that causes issue to happen):
I then enable McFly by pressing Ctrl+R
and immediately exit via Esc
. After that I'm seeing that 2 commands were executed and are displayed on screen:
#mcfly:
mcfly search
Is there any reason for not to removing these commands (e.g. I'm not seeing any extra commands, when using native Ctrl+R
search)?
Related #44
Multiline commands are sometimes split in bash history.
Pasting this in the terminal and then pasting the following:
some_function () {
printf '1\t2\t3\n' \
| awk -F '\t' '
{
print $1;
print $2;
print $3;
}' \
| cat
}
In bash without mcfly, pressing the up key, will bring back this full entry (history command):
2006 some_function () { printf '1\t2\t3\n' | awk -F '\t' '
{
print $1;
print $2;
print $3;
}' | cat ; }
With mcfly, this entry is splitted:
1340 some_function () { printf '1\t2\t3\n' | awk -F '\t' '
1341 {
1342 print $1;
1343 print $2;
1344 print $3;
1345 }' | cat ; }
If I run a command in bash:
$ echo goodbye world
goodbye world
I then press Ctrl-r goodbye Ctrl-c
, and I see this in my bash session:
$ echo goodbye world
goodbye world
$ #mcfly:
$ mcfly search
$
• • • source mcfly.bash
• • •
McFly: Upgrading McFly DB to version 3, please wait...thread 'main' panicked at 'McFly error: Unable to add cmd_tp
l to commands: SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("duplicate column name: cmd_tpl"))',
src/libcore/result.rs:999:5
stack backtrace:
0:
1:
2:
3:
4:
5:
6:
7:
8: main
9: __libc_start_main
10:
When attempt to make temp file in mcfly.bash
is made it ends up with this error:
mktemp: cannot create temp file /tmp/mcfly.XXXX: Invalid argument
Googling a bit showed, that adding more X
to the temp file creation command solves the problem.
I'm using Slackware Linux x64.
When I am in the history viewer, I would like to be able to select an item in the list with the arrow keys, hit the delete key, and have it removed from history.
Seems return exit code 1 when . ./{path to mcfly.bash}
execute in .bashrc
The last exit code 1 disappear if I comment this line in mcfly.bash
:
...
PROMPT_COMMAND="__last_exit=\$?;history -a \$MCFLY_HISTORY;mcfly add -
-exit \$__last_exit --append-to-histfile;history -cr \$MCFLY_HISTORY;$
{PROMPT_COMMAND}"
...
...but It does affect the program, myfly can;t save lastest history
I'm seeing #mcfly:
entries, when using history
command.
Since McFly does regenerate .bash_history
file used by history
command, then it likely could remove mentions to itself from there.
Hi, I just installed mcfly to try it out on macOS 10.14.2 (beta 18C52a). I opened a new shell, and saw the "reading history for the first time" message. I closed that shell and opened another, and saw this message:
-bash: /var/folders/kb/bswbcrr56ld5cv7zzhyp57gr0000gn/T/mcfly.XXXX.qqMnwGRv: cannot overwrite existing file
If I remove the file, and open another shell, I get a message with a similar file name. When I ls -l
the permissions string is -rw-------
for the file, and drwx------@ 254 gwk staff 8128 Dec 3 19:02 T
for the parent T
directory. Any ideas?
Really enjoying mcfly, thanks for making it!
With the Solarized Light color scheme, all of the un-highlighted suggestions are invisible (see attached images).
If this isn't a priority for you, I'd be happy to hack on it some time.
I poked a bit through interface.rs
and settings.rs
. From a cursory examination, seems like one way to add a light mode would be for settings.rs
to look for an environment variable (MCFLY_LIGHT
?) around here, set a bool in settings, and then for menubar()
prompt()
and results()
to act accordingly. Would that be your preferred way of propagating a setting like that?
/usr/local/opt/mcfly/mcfly.bash:23: command not found: shopt
/usr/local/opt/mcfly/mcfly.bash:47: command not found: bind
I have HISTCONTROL=ignoreboth
(acts as ignorespace;ignoredups
) in my .bash_profile
file to avoid seeing same command again and again, when browsing through history using Up/Down arrows when I've executed same command several times.
As I've noticed it that takes priority over HISTCONTROL=ignorespace
set in mcfly.bash
.
Would that cause any problems to McFly ability to detect multiple sequential same command execution attempts and therefore increase probability for suggesting that command over other commands?
On Linux/Debian i have the following problem:
# RUST_BACKTRACE=1 mcfly -d search
McFly: Upgrading McFly DB to version 3, please wait...thread 'main' panicked at 'Unable to add cmd_tpl to commands: SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("duplicate column name: cmd_tpl"))', libcore/result.rs:1009:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::panicking::default_hook::{{closure}}
at libstd/sys_common/backtrace.rs:71
2: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:227
at libstd/panicking.rs:476
3: std::panicking::continue_panic_fmt
at libstd/panicking.rs:390
4: rust_begin_unwind
at libstd/panicking.rs:325
5: core::panicking::panic_fmt
at libcore/panicking.rs:77
6: core::result::unwrap_failed
7: mcfly::main
8: std::rt::lang_start::{{closure}}
9: main
10: __libc_start_main
11: _start
McFly: Upgrading McFly DB to version 3, please wait...thread 'main' panicked at 'Unable to add cmd_tpl to commands: SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("duplicate column name: cmd_tpl"))', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Just a feature request: Similar to what some editor's autocomplete does, when the user types in all lowercase letters, behaves case insensitively by default. But if the input contains any uppercase letters, switches to case sensitive mode by giving each exactly matched character some extra points so those candidates rank higher on the list.
This is useful when the command starts with an environment variable, e.g., RUST_LOG=...
.
Great idea! Tried it on my Mac with bash from homebrew (4.4.23(1)-release) and faced a few issues:
tr
fails here: https://github.com/cantino/mcfly/blob/master/mcfly.bash#L8 with tr: Illegal byte sequence
. Seems like LC_CTYPE
is not enough, need to set LC_ALL=C
, it seems to work that way.
After pressing ctrl-r and ctrl-g to get back to the shell, I see this:
[2018-12-04 02:25:56][prod] konstantin:~
$ #mcfly:
[2018-12-04 02:25:59][prod] konstantin:~
$ mcfly search
[2018-12-04 02:26:06][prod] konstantin:~
$
Looks like in this line: https://github.com/cantino/mcfly/blob/master/mcfly.bash#L47 it is executing commands quite literally in the shell, displaying what it's doing. Not sure if it's a mac funkiness or my particular setup or what, but it's annoying.
In standard bash, after pressing ctrl-r and typing something I can keep scrolling back in time by pressing ctrl-r again, and I have a spinal reflex for that. mcfly just drops me back out to the shell, rendering itself effectively unusable for me.
Thanks for your effort. I will try to keep using it, despite the third point, and report what I find.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.