Commit graph

162 commits

Author SHA1 Message Date
Ehab-24
9f85d684a1
Emacs style case conversions (#5898)
This PR introduces the following changes to rizin shell:

- Use Meta-L to lowercase the following word
- Use Meta-U to uppercase the following word
- Use Meta-C to capitalize the following word

The behavior of these actions is the same as in zsh.
2026-03-11 16:52:52 +00:00
Arya H R
88cd68cb52
shell: escape reverse-search and forward search with the Esc key 2026-02-01 16:00:42 +08:00
Maijin
797fcd0ff6
test: increase coverage for RzCons and its components (#5735)
- Added tests for Cons Canvas, Histogram, HUD, Pal, Pager, Pipe, RGB, HTML, Line.
- Fixed rz_str_ansi_filter null terminator bug.
- Refactored test_cons.c by splitting it into smaller files.
- Improved many existing assertions to verify actual output content.
- Restored mu_assert_notnull checks for better reliability.

Co-authored-by: Maijin <maijin21@gmail.com>
2026-01-07 12:27:45 +08:00
Maijin
a03e8ded3b
test: add tests for horizontal histogram ruler (p==) (#5709)
* test: Add tests for horizontal histogram ruler (p==)

Co-authored-by: Maijin <maijin21@gmail.com>
2026-01-06 00:30:08 +08:00
Arya H R
de5464698b
dietline: Ctrl+G for the soft escape from backward search (#5667) 2025-12-25 22:05:35 +08:00
Khairul Azhar Kasmiran
1cdb88be5a
Rename rz_str_len_utf8() to rz_str_utf8_cols() (#5626)
* Rename rz_str_len_utf8() to rz_str_utf8_cols()
* Rename utf8strlen0() to utf8strcols0()
2025-12-16 20:09:39 +08:00
Giovanni
2f97762b09
librz/core: Remove rizin command output (#5540)
* Remove RIZIN command output for the old projects

* Fix cmeta.c

* Fix ik command

* Revert back pc*

* fix formatting cmd_descs_generate.py

* Fix rz_cons_pal_list_as_css

* Fill all info about colors for ec commands.

* Fix all tests
2025-11-28 23:41:47 +08:00
Ahmed Kamal
d2c2db5f14
refactor: remove globals from librz/cons/cons.c (#5314) 2025-08-26 12:01:51 +08:00
e
e637ad9723
librz/cons: add horizontal histogram ruler (#5287)
* Add ruler to horizontal histogram
* Add histogram ruler option `scr.hist.ruler`.
* Fix typos
2025-07-26 17:12:21 +08:00
Rot127
0c0f868646
Add ?**, ?**e, ?*** for interactive search of command and settings details (#5062)
* Add ?** as alias for ?*~...

* Zero initialize the help desc copy.

Fixes a bug when detail_cb was called but it was just garbage.

* Implement ?***

* Add tests for interactive command search

* Add string buffer output mode for internal use and use it for setting help.

* Add ?**e for interactive search of config values.
2025-07-08 12:06:39 +00:00
Giovanni
76d41f75f8
Fixes for Haiku OS (#5149)
* Fix sys.c unused variable.
* Add native/unsupported.c
* Clean rz_debug.h from comments and functions which does not exists
* Add fall-thru comment for haiku os case
* Fix warning: "MIN" redefined /boot/system/develop/headers/posix/sys/param.h:18: note: this is the location of the previous definition
2025-05-18 20:17:40 +08:00
Giovanni
6c8c2b56bb
Fix some coverity issues. (#5043)
* Fix CID 436263 Resource leak
* Refactor names and fix CID 316211 Res
* Fix CID 434354 Resource leak
* Fix CID 350586 Logically dead code
* Fix CID 317123 Logically dead code
* Refactoring and Fix CID 401538 Logically dead code
* Fix CID 471305 Logically dead code
* Fix CID 316396 Logically dead code
* Fix 316248 Logically dead code
* Fix CID 365932 Logically dead code
* Fix CID 365945 Logically dead code
* Fix CID 464683 Overflowed integer argument
* Fix CID 478061 Resource leak
* Fix CID 477908, 477950 Resource leak
* Fix CID 477882 Resource leak
* Fix CID 478030 Resource leak
* Fix CID 478058 Resource leak
* Fix CID 477829 Resource leak
* Fix CID 477973, 477991 Resource leak
* Fix CID 477970 Resource leak
* Fix CID 366822 Dereference after null check
* Fix CID 478059 Resource leak
* Fix CID 477874, 478012 Resource leak
* Fix CID 478074 Logically dead code
* Fix CID 408926 Dereference after null check
2025-03-27 12:38:42 +08:00
NOT XVilka
778c9f00e3
librz/cons: fix defragger theme (#5039)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-03-25 21:58:56 +08:00
Khairul Azhar Kasmiran
feccb9bf85
rz_cons_clear_line: Change param type to FILE * (#4974) 2025-03-08 17:16:43 +08:00
Rot127
b39ef58df2 Fix segfault if sorted or unsorted lines are empty. 2025-02-22 04:12:49 +08:00
Khairul Azhar Kasmiran
2d039ee84f
^ grep op: Skip whitespace (#4875) 2025-02-02 13:09:07 +08:00
Khairul Azhar Kasmiran
37517f7a2c
/e: Set NUL (\0) as newline (#4862)
* Add compile context arg to `rz_regex_new()`
* `/e`: Set NUL (`\0`) as newline
2025-01-25 19:07:34 +08:00
Giovanni
e78a7be614
Remove dead code (#4705) 2024-11-08 18:46:13 +08:00
Giovanni
db1e4993a0
Replace strdup with rz_str_dup (#4634) 2024-09-15 19:12:07 +08:00
s1gse9v
a3ffd6e381
dietline: rz_line_readline_cb pass line to __move_cursor_left instead of NULL (#4544) 2024-06-09 10:12:27 +08:00
Peiwei Hu
29b303a3c6
cons: remove useless member <lastline> (#4540)
* also fix several memory leak
2024-06-07 13:28:27 +08:00
pelijah
87a0da83d6
Fix heap buffer over-read in pal.c (#4455) 2024-04-21 17:54:33 +03:00
pelijah
f2d8e0db3d
Add HtSP, HtSS, HtSU, SetS (#4415)
- All `ht_*_new0()` are removed
- `freefn` field of HT options was renamed to `finiKV`
- `finiKV_user` fields was added to HT options
- Added `ht_*_new_opt_size` API
- `HtSP` and `HtUP` are created with `ValueFree` callback  that allows to reduce extra LOC and prevent bugs
- `SetP` replaced with `SetS` (based on `HtSP`)
- `rz_th_ht_*_new0()` and `rz_th_ht_*_new_opt()` are replaced with `rz_th_ht_*_new(HtXX *)`
2024-04-16 20:27:48 +08:00
Rot127
53235602e4 Fix inlcudes 2024-03-01 01:14:07 -05:00
Rot127
f0435d94cc
Trim grep expression before processing it. (#4227) 2024-02-14 21:43:42 +08:00
Giovanni
2886608d59
Rewrite how rz_cons_pipe_open/close behave to remove globals (#4223) 2024-02-14 09:05:17 +08:00
Anton Kochkov
fa455f8b52
cons/dietline: remove some static variables (#4218) 2024-02-13 18:24:53 +08:00
Anton Kochkov
86560ee699
cons/grep: remove global state (#4210) 2024-02-12 15:33:20 +08:00
Anton Kochkov
25fd417a28
Add user pointer to RzListComparator (#4204) 2024-02-11 13:28:33 +08:00
Rot127
5afc51f0e2
Replace current regex engine with PCRE2 (#4185)
* Replace OpenBSD regex library with PCRE2.

PCRE2 has way better performance than the OpenBSD
library (something around 20 times faster).

The following flags are enabled for every pattern:

- PCRE2_UTF
- PCRE2_MATCH_INVALID_UTF
- PCRE2_NO_UTF_CHECK

All the others are optional.

Changes made:

- Adds PCRE2 as subproject.
- Changes the API away from POSIX to PCRE2.
- Edits many regex patterns because:
 - ' ' is skipped in patterns, if the EXTENDED flag is set for matching. '\s' must be set now.
 - '.' doesn't match newlines by default.
- Changes the API so matches and their groups are bundled into PVectors.
- Moves the regex component to rz_util.

* Fix cross build - add copy of PCRE2 dependecy

Meson currently doesn't support subprojects to be native and non-native at the same time.
See: https://github.com/mesonbuild/meson/issues/10947
Unfortunately, sdb depends on rz_util which in turn depends on PCRE2.
Excluding PCRE2 from the native build makes linking of rz_util not possible anymore.
Adding it, will make Meson complain that the dependencies cannot be mixed.

Hence, we compile a copy of PCRE2 for the native build if required.
2024-02-05 12:51:16 +08:00
Anton Kochkov
1f4befd24e Remove global RzLine instance 2024-01-07 22:40:25 +08:00
wargio
f7589feb05 introduce user pointer in comparator to remove globals in table.c 2024-01-06 23:30:07 +08:00
wargio
a9131cede7 Remove hidden static in rz_str_pad 2024-01-06 23:30:07 +08:00
Riccardo Schirone
3b903caa96
librz: add some initial documentation (#3782) 2023-10-13 13:46:19 +08:00
Mikael Berthe
b9281cbc9c
Fix arrow keys on some terminals (#3718)
* Add support for arrow keys on some terminals

Some terminals use the sequences \EO{A,B,C,D} for the arrow keys
(e.g. xterm, tmux, screen).

* Remove cursor move on Ctrl-l

^L clears the screen as expected, but the cursor is moved and it is
probably not intended.
2023-08-09 20:44:01 +08:00
Parth Bansal
bd0a430e8e
Interactive horizontal histogram for p== commands (#3688) 2023-08-01 12:00:59 +08:00
billow
94f2fae87e
Fix compile warnings (#3550) 2023-06-02 13:07:51 +08:00
Riccardo Schirone
99213043de
cons: enable VI mode with ESC only, no alt-ESC (#3464) 2023-04-23 10:49:58 +08:00
Riccardo Schirone
9a2843c32e cons: make RzLineUndoEntry public in rz_cons.h to fix rz-bindgen 2023-04-22 21:48:46 +08:00
ez2take
a36f34da2b
Add Undo/Redo to dietline emacs mode. (#3445) 2023-04-14 11:56:01 +08:00
Siddharth Mishra
9ab709bc34
Improve cmd_help.yaml and fix random number generator (#3452)
* Improve cmd_help.yaml and fix a small bug
* Add support for 64bit random numbers
* Make a distinction between 32- and 64-bit PRNG
* Add documentation for new functions
* Change the RBTree test to use 32-bit random numbers
2023-04-07 20:22:01 +08:00
Anton Kochkov
50d17471e7
Remove dead code in RzCons dietline (#3405) 2023-03-01 12:33:05 +08:00
Peiwei Hu
a0e9750913
Mute the mouse in the HUD mode (#3355) 2023-02-07 17:07:35 +08:00
Anton Kochkov
1558f586ac
Fix big memory leak in graph rendering (#3342) 2023-02-05 16:57:31 +08:00
Anton Kochkov
969ce2e570 Add an example of vertical histogram in comment 2023-01-31 08:27:30 +08:00
Peiwei Hu
276306b587
Add search.case_sensitive for grep case-sensitive/insensitive (#3241) 2022-12-28 09:38:32 +08:00
Peiwei Hu
1938890035
Fix: grep(~) will change the original result when ignores case (#3259) 2022-12-25 08:01:06 +08:00
Anton Kochkov
1d3fbac74a
Add Nord color theme (#3250) 2022-12-18 11:48:15 +08:00
Anton Kochkov
dcaf3ecd69
Add Mars color theme (#3252) 2022-12-17 20:25:41 +08:00
Anton Kochkov
f2ca09fe24
Extract histograms and bars into RzCons (#3189) 2022-11-17 14:41:50 +01:00