Commit Graph

251 Commits

Author SHA1 Message Date
23bed00467 Fix for weird terminal behavior (e.g. not echoing user input for
subprocesses if bb was started with the terminal attributes set with NOECHO) by setting up a "default" termios struct with sane settings instead of relying on bb being launched with sane settings.
2019-09-21 16:38:53 -07:00
ba7b44a3e7 Fix for broken behavior in the help menu (hanging when reaching the end,
due to not close()ing the file descriptor, and exiting on ctrl-c)
2019-09-21 13:40:35 -07:00
651e58c9c9 Removed +bind functionality. 2019-09-12 18:56:27 -07:00
e1e34bc6ed Replaced marks system with something a little more elegant using
symbolic links in ~/.config/bb/marks/. The new version is a little more
flexible (arbitrary mark names), persistent across bb sessions, and uses
a bit less code.
2019-09-12 18:41:15 -07:00
52a2b30692 Fixed mistake in bb function conditional 2019-09-07 21:47:22 -07:00
5927e68bb7 Fix for potential buffer overflow. 2019-07-15 22:21:08 -07:00
47f66e49a7 Added fallback for if binding has no description. 2019-07-12 16:24:27 -07:00
da6bb91763 Overhaul to use a shell function for internal commands instead of bb
itself, which lets bb work when not yet installed.
2019-07-12 16:19:31 -07:00
61cf1bf90c Fixed issue with extra '/' appearing in link paths 2019-06-19 16:45:10 -07:00
6f660ac236 Fix for Esc key causing hang 2019-06-19 00:57:04 -07:00
199cda1222 Removed unused import 2019-06-19 00:52:12 -07:00
00a99738e8 Removed last traces of timeouts in bterm.h 2019-06-18 21:21:27 -07:00
a57b5f44db Removed all the /dev/tty redirection and just dup2()'d it before
exec()ing the user scripts
2019-06-18 21:16:32 -07:00
0b977d2a8f Fixed change that broke bb -d by clearing bb's path prematurely. 2019-06-18 17:08:13 -07:00
634a8517b1 Merge branch 'master' of bitbucket.org:spilt/bb 2019-06-18 17:02:17 -07:00
b86066b46a Merge branch 'master' of bitbucket.org:spilt/bb 2019-06-17 16:50:14 -07:00
c9343baf15 Fixed onscreen off-by-one error 2019-06-17 16:50:03 -07:00
fbfe8689a8 Changing IO code to no longer use poll() in favor of just reading input
and using VMIN and VTIME.
2019-06-17 16:45:24 -07:00
8d5e68d444 Fix for term attrs getting messed up by Fish shell 2019-06-17 14:52:38 -07:00
e09bb2d3ed Added comment 2019-06-15 19:07:00 -07:00
ac29ef42cf Fixed some path normalization errors with ".." and simplified the
populate_files code a bit
2019-06-15 19:05:57 -07:00
f2298a5786 Condensed selection code by converting select_entry()/deselect_entry()
to set_selected() with an argument for whether the file should be
selected.
2019-06-15 18:21:37 -07:00
4c717185de Cleaned up and deduplicated some of the path normalization code. 2019-06-15 18:13:44 -07:00
302ed33d9c Sorted function declarations alphabetically, got rid of clear_selection
(now just inlined), and replaced remove_entry() with try_free_entry() to
eliminate duplicate safety checks.
2019-06-15 18:02:14 -07:00
ff800b2377 Allow piping in commands when launching bb (e.g. `printf '+sel:%s\0' * |
bb`)
2019-06-15 16:21:50 -07:00
f372995750 Fix for normalizing paths better, particularly for places other than
cd_to_path and for non-directory paths (e.g. +sel:../foo.txt)
2019-06-15 16:20:38 -07:00
7a757b7906 Version bump and added +bind doc 2019-06-15 14:15:53 -07:00
b91dbdd3d0 Added $BBDOTFILES, and updated bindings to use it properly. Removed the
`+select:*` and `+deselect:*` in favor of just using shell commands for
those functions.
2019-06-15 14:14:05 -07:00
45a08afbbd Added +bind command to allow for stuff like bb +"b:\r:echo \$BBCURSOR && bb +q" 2019-06-15 14:13:35 -07:00
1239060641 Fix for free-after-use caused by hardlinked files (reverting earlier
change that assumed files with equal inode/idev were the same)
2019-06-15 14:07:46 -07:00
5b1344db44 Fix for ALTSCREEN getting broken by CTRL-Z 2019-06-15 14:02:32 -07:00
8000a4a1bb Renamed command->script in more places to avoid confusion. 2019-06-12 18:55:55 -07:00
bd06e6c99a Improved some names (process command/run script) and changed quit to use
a flag on bb_t instead of a return value.
2019-06-12 18:52:10 -07:00
4bac1a740a Cleaned up commands a bit and changes 'P' from using grep for patterns
to select to 'S' to use shell globbing
2019-06-12 16:57:07 -07:00
69955d3808 Switched some stuff to use $() instead of `` for better composing,
rearranged things a bit to launch bb fewer times for commands.
2019-06-12 15:11:29 -07:00
91a31ee7e6 Show cursor after ctrl-c 2019-06-10 22:57:26 -07:00
e094108f11 Don't show '..' from '/' 2019-06-10 22:55:53 -07:00
15e5de72f7 Version bump 2019-06-10 20:39:00 -07:00
5a5f9afa05 Updated with some cleaner behavior for PICK and added SPIN. Also removed
command line flags in favor of manually using `tput rmcup`. Updated the
documentation.
2019-06-10 20:37:34 -07:00
399b63f57c Fix for being unable to deselect nonexistant files 2019-06-09 15:46:34 -07:00
257f8ee0d0 Fix for top level '/' dir edge cases 2019-06-06 23:28:03 -07:00
9ab3ad0fa0 Bumped version 2019-06-06 18:13:58 -07:00
76f1cd816b Removed some unnecessary +refreshes and just set the dirty bit to 1
whenever an external program runs so the screen redraws without
necessarily refreshing the file listing.
2019-06-06 18:13:13 -07:00
380f2a8ab0 Removed code for move cursor to position (unused) 2019-06-06 18:09:33 -07:00
47019164a5 Fixed some wrap/cursor visibility issues 2019-06-06 15:37:26 -07:00
32b414e555 Removed breadline() and switched to use ask when possible, defaulting
to `read` and `fzy`
2019-06-06 15:33:20 -07:00
921b7ed4f8 Fixed issue with navigating to parent not selecting previous directory. 2019-06-04 21:14:49 -07:00
2db997c9e0 Fixed issue with non-NORMAL_TERM commands that set and reset alt screen,
and fixed issue with "(n) selected" message
2019-06-04 14:05:14 -07:00
824445c2fa Cleaned up scrolling logic 2019-06-04 13:44:43 -07:00
888f859e97 Improved the randomization a bit, so the numbers are evenly distributed
[0,n) instead of [0, RAND_MAX), also cleaned up config file a little
2019-05-31 21:51:08 -07:00
18b98c8543 Made links dim (-> foo) instead of just the arrow 2019-05-31 18:57:32 -07:00
0fa6e3a636 Compacting the code, putting column names with widths 2019-05-31 17:59:58 -07:00
05601c886b Added "<selection>" virtual directory, added '-' mark for "last
non-virtual directory" and 's' for "selection virtual directory",
cleaned up path normalization, added "N selected" visualization.
2019-05-31 17:44:18 -07:00
ca9ff7e941 Moved colwidths to config 2019-05-31 14:56:25 -07:00
06fa2d5b3c Got rid of +align command, and simplified column width logic (no more
auto-sizing, no more alignment, everything just has a static width now)
2019-05-31 14:52:57 -07:00
019ae526da Fixed some redraw dirty flag issues 2019-05-31 14:34:17 -07:00
961ac49f81 Simplifying interleave code and adding doc 2019-05-31 13:26:23 -07:00
17ce3f08df Moving interleave-dirs back from a full column to just a setting 2019-05-31 13:23:01 -07:00
c237e80bae Added a bit of extra spacing around columns 2019-05-31 13:14:29 -07:00
6ffae6ed30 Cleaned up some T_WRAP stuff 2019-05-31 13:11:09 -07:00
182af5c2af Switched to use cfmakeraw() instead of manually setting a bunch of
termios bits.
2019-05-31 13:05:12 -07:00
f019a8b0f5 Fixed some stuff with alt screen and spurious output to stdout 2019-05-31 12:59:36 -07:00
c7ce37ffbf Version bump 2019-05-31 12:48:48 -07:00
f539538582 Cleaned up a lot of the cd logic, making path names better-standardized,
but still keeping symlinks, and ensuring bb->path has a slash at the
end. Also cleaned up some empty directory errors.
2019-05-31 12:47:35 -07:00
e11158a69f Moved populating files before startup commands, so '+mark:0' works
properly
2019-05-31 01:17:23 -07:00
ed5d87f9a2 Fixed some memory errors, including a use-after-free. Simplified the
refcount by just explicitly tracking whether a file is being viewed and
whether it's selected.
2019-05-31 01:09:21 -07:00
f78a4d591d Added permission flags for created bb cmdfile 2019-05-31 00:25:32 -07:00
6db0c1bed4 Fixed one more qsort argument issue 2019-05-31 00:22:37 -07:00
928b712ad7 Fixing some qsort_r arg problems 2019-05-31 00:17:01 -07:00
9faede6193 Updating with more mac compatibility 2019-05-31 00:12:21 -07:00
72ed507499 Got everything working on linux 2019-05-31 00:03:48 -07:00
1627621246 realloc() -> reallocf() to be extra safe 2019-05-30 22:26:00 -07:00
33e4fc2600 Simplifying command control flow 2019-05-30 22:25:22 -07:00
405786b7c9 Cleaned up a bunch of stuff, including finding entries, a sorting bug,
and some command stuff.
2019-05-30 18:44:56 -07:00
e2350214ae Bumped version 2019-05-30 18:08:49 -07:00
48a55d7bca Inlined the options to bb_t, and added a dirty flag instead of the
'lazy' variable
2019-05-30 18:08:19 -07:00
c847980757 Finally got everything working with a refactor to use hash lookups
everywhere
2019-05-30 18:00:00 -07:00
f4d9510cbf Code cleanup 2019-05-30 00:33:51 -07:00
6a5ca2cd0c Updated some doc and removed the "-B" flag for full key binding info 2019-05-30 00:02:25 -07:00
2f34dad8e8 Deleted CTRL_H functionality. 2019-05-29 23:44:22 -07:00
050d4d70ca Some cleanup of text coloring 2019-05-29 19:45:23 -07:00
c1968201d9 Tweaked some default layout stuff, fixed some flushing issues with
ctrl-h, adjusted coloring to only apply to filenames
2019-05-29 19:32:52 -07:00
05b9318c10 Removing +opts in favor of just having commands for each setting. Also
removed initialopts
2019-05-29 18:00:49 -07:00
2d7d20f9a1 Overhaul of sorting and columns, simplifying and unifying things a bit 2019-05-29 17:26:18 -07:00
ca45d7750c Version bump 2019-05-29 00:58:33 -07:00
38408b5499 Cleanup of the rendering code, including making the selection column a
proper column (+)
2019-05-29 00:56:49 -07:00
d38e166151 Simplified the opts API a bit, cleaned up the code a little, added a
toggle_file() function
2019-05-28 23:51:20 -07:00
f070b5da03 Adding comment about . 2019-05-28 22:30:04 -07:00
53ad739616 Added documentation for all functions, simplified sorting a little 2019-05-28 22:29:22 -07:00
331a004dff Code cleanup, replaced fisher-yates shuffle with worse, but much simpler
shuffle.
2019-05-28 22:04:02 -07:00
0a1258a747 Tweaked some defaults and allowed cursor color to be combined with
existing color.
2019-05-28 21:46:16 -07:00
8d4e4aeba4 Some major refactoring including moving more stuff into bterm.h (renamed
from keys.h), a custom readline (`read` was buggy), better
customization, and improved renaming bindings.
2019-05-28 21:36:42 -07:00
92a198d6b6 More cleanup of struct members, fixed some text wrapping issues that
lingered after exit, and removed some debug code
2019-05-28 00:07:43 -07:00
c1fabab57d Cleaned up some redundant and poorly named fields 2019-05-27 21:14:34 -07:00
111cf0948c Cleaned up the refcounting code a little bit with better naming 2019-05-27 20:55:36 -07:00
6e39f580f6 Better column positioning, including centering and left-aligning when
appropriate.
2019-05-27 20:13:11 -07:00
32b32143e9 Bumped version 2019-05-27 19:51:33 -07:00
109f6a96d4 Refactored the column spacing a bit and added more powerful options for
columns
2019-05-27 19:51:04 -07:00
cd6a58f872 Changed explore API to take a bb_t parameter. 2019-05-27 16:14:14 -07:00
9f15415bcd Some minor cleanup, enforcing "bb" as the name for the bb state, inlined
a few things, moved firstselected onto the bb state instead of a global.
2019-05-27 16:08:29 -07:00
1ba70f4221 Cleanup of a bunch of the terminal code 2019-05-27 15:53:07 -07:00
e12759b48c Switched to use file pointers instead of file descriptors. 2019-05-27 14:12:47 -07:00
4aa93906e7 Moved a bunch of the config options into the config file (colors, etc.)
and fixed some rendering issues
2019-05-26 16:34:48 -07:00
75c2f4e169 Fixed a bunch of alignment issues with unicode names and stuff, fixed
and issue with linked list removal, and added a bunch of error checks
for commands with no value.
2019-05-26 16:01:56 -07:00
ab6ef2ef0c Formatting cleanup and MAX_PATH -> PATH_MAX rename to use actual value 2019-05-26 13:41:09 -07:00
3579e90a5b Made some fixes after testing on linux, changed +mark syntax to use '='
instead of ';'
2019-05-26 02:37:41 -07:00
d00596ca44 Fixed text wrapping (now just truncates) 2019-05-25 23:35:04 -07:00
b0496356f3 Added version 2019-05-25 23:31:03 -07:00
5d20b81fc3 Added support for SHOW_CURSOR 2019-05-25 23:28:08 -07:00
f3b052d47c Updated docs and added some refresh consistency 2019-05-25 21:47:30 -07:00
c9bb7f4944 Some major refactoring, removed the tabs feature, added marks (much
simpler)
2019-05-25 20:55:59 -07:00
d111493a8d Lots of refactoring, including adding function stubs 2019-05-25 04:30:51 -07:00
e5ac52b1d5 Added shuffle functionality, cleaned up and improved column drawing, and
did a ton of cleanup of compiler warnings.
2019-05-24 20:49:24 -07:00
53bee94a9f Fixed some stuff, including 'cd' 2019-05-24 17:42:36 -07:00
bbeecf3b2f Refactored a bit, allowed cmds to use unique prefixes (e.g. 'q' instead
of 'quit', 'scr' instead of 'scroll', etc), added vim modelines
2019-05-24 17:35:16 -07:00
8b48d29afa Cleanup and refactoring. More robust handling of command files, and
guaranteed tmpfile deletion on exit (even with SIGTERM, ctrl-c, etc.).
Also fixed some bugs with suspend hiding cursor, not handling multiple
commands, duplicating commands, etc.
2019-05-24 16:55:36 -07:00
89f65d6a26 Fixed bug 2019-05-23 19:14:50 -07:00
752a23c5f6 Lots of refactoring and cleanup 2019-05-23 19:04:17 -07:00
aa297e79d3 Fixed an issue with leaking temp files 2019-05-23 05:51:11 -07:00
2862756733 Added flags for toggling columns, cleaned up a bit 2019-05-23 05:42:33 -07:00
670ee76177 Added key binding tool (ctrl-h) to figure out what a binding is 2019-05-23 04:44:48 -07:00
ce72a889e2 Properly handle window resizes 2019-05-23 04:02:11 -07:00
fcfb1a3995 Help menu overhaul and cleanup of config file 2019-05-23 03:40:04 -07:00
e0cad5a44f Moved sorting to a command 2019-05-23 02:13:13 -07:00
b5642e84d8 Moved more stuff over to bb commands, cleaned up scroll region stuff 2019-05-23 01:37:41 -07:00
e080490d51 Working version of running (nearly) everything on bb IPC commands 2019-05-23 00:57:25 -07:00
566ee2f272 Added lazy redrawing using console scrolling 2019-05-22 19:05:56 -07:00
ac69e52faa Added polling for blocking key reads 2019-05-22 15:47:47 -07:00
512cbbdae4 Removed some redundant exits 2019-05-22 15:33:18 -07:00
68cc3ecf33 Fixed bug with number of arguments 2019-05-22 14:56:28 -07:00
5f0e1bf0be Overhaul to use arguments instead of piping for commands 2019-05-22 14:33:14 -07:00
292d1953e8 Updating naming 2019-05-22 01:56:39 -07:00
0d6724017b Added help/usage 2019-05-22 01:55:34 -07:00
51959819dd Removing dead code 2019-05-22 01:52:23 -07:00
3a2438dc08 Better arg parsing and updated docs 2019-05-22 01:50:46 -07:00
8f73ec7241 Added null-separation option for xargs to properly handle funky
filenames
2019-05-22 01:39:15 -07:00
0755256039 Added dynamically generated help, fixed some ctrl-c stuff. 2019-05-22 00:25:25 -07:00
b7b6b6cc74 Added ctrl-z for suspend and added a sort of hybrid mode for running
commands at the bottom of the screen instead of in a full terminal mode.
2019-05-21 22:41:22 -07:00
bff00bf755 Deleted the prompt code. Scripts can just do that instead. 2019-05-21 21:47:41 -07:00
6c29017c62 Added some more keybindings and cleaned up a bit 2019-05-21 21:45:16 -07:00
3d401cd701 Updates and improvements. 2019-05-21 20:06:53 -07:00
1a0382f55d Added fuzzy finding 2019-05-21 17:13:28 -07:00
3678e7608f Tidying up 2019-05-21 16:32:26 -07:00
170fb41568 Changed info for symlinks to be about link instead of linked file 2019-05-21 16:30:49 -07:00
e2fe374f92 Fixed up ctrl-a and esc for select all and clear 2019-05-21 16:29:01 -07:00
2d90cc8fd6 Added a bit more functionality including a user input prompt 2019-05-21 16:02:25 -07:00
6957d67051 Some changes to sorting and mouse wheel scrolling. 2019-05-21 05:10:39 -07:00
f7e99b3077 Added command line flags 2019-05-21 04:06:50 -07:00
ab46185843 Lotsa improvements 2019-05-21 03:59:30 -07:00
9786f9a525 Mostly working version with linked lists and regular arrays 2019-05-21 02:17:11 -07:00