Compare commits

...

1606 Commits

Author SHA1 Message Date
ridiculousfish
51f9ff5389 Updated make_tarball.sh to stop dumping files in the extract directory 2012-05-30 01:06:25 -07:00
ridiculousfish
4986e6e3f9 Fix to set up 10.6 SDK correctly when building on 10.7 2012-05-30 00:27:50 -07:00
Peter Ammon
9d8ae184c9 Fix for annoying messages when launching on SnowLeopard
Fix for missing .o file in Makefile.in
2012-05-30 00:22:45 -07:00
ridiculousfish
4afdcf56fc Tweak a few default colors
Fix the make_pkg script to actually build an installable package that doesn't immediately barf
2012-05-29 21:14:19 -07:00
ridiculousfish
0fe43eb880 Fix to (really) no longer require Doxygen to build fish 2012-05-29 20:50:27 -07:00
ridiculousfish
4edfd6d9d6 Update set_color documentation 2012-05-25 02:14:26 -07:00
ridiculousfish
8351ec0afd Document some of the new commands 2012-05-25 02:07:21 -07:00
ridiculousfish
92ce84c26a More tweaks to Debian build script 2012-05-25 00:48:39 -07:00
ridiculousfish
9d31e52b2a Updated Debian package build script 2012-05-24 23:58:16 -07:00
ridiculousfish
dcd7d6769d Updated some build scripts 2012-05-24 23:56:07 -07:00
ridiculousfish
87c0e0e971 Tweaked make_deb script 2012-05-22 00:09:39 -07:00
ridiculousfish
6f9a523151 Some tweaks to build tools
Started make_deb.sh for Debian package
2012-05-22 00:05:41 -07:00
ridiculousfish
673faf7152 Fixed builtin_test to properly handle "just a strings" in combining expressions, like 'test foo -a bar'. This was causing error messages in the help function.
Fixed help function to know about OS X and use the open command to open web pages.
2012-05-20 12:58:03 -07:00
ridiculousfish
18ace555b0 Added release notes for beta 1 2012-05-19 17:04:45 -07:00
ridiculousfish
d09c9fba02 Added a -s option to echo to mean "don't output spaces"
Replaced default prompt to stop calling printf. I opened a bug to replace the default prompt entirely with one that's cheaper.
2012-05-19 16:59:56 -07:00
ridiculousfish
f1d22b6300 Got function.h and function.cpp off of shared_ptr (hooray) 2012-05-18 14:00:36 -07:00
ridiculousfish
da6295c428 More work towards getting function.h off of shared_ptr 2012-05-17 19:46:08 -07:00
ridiculousfish
86645b32e1 Work towards getting function.h off of shared_ptr 2012-05-17 19:38:08 -07:00
ridiculousfish
977c585f8b Made the OS X installer package flat 2012-05-17 19:37:26 -07:00
ridiculousfish
4c1ddab560 Tweaked Makefile.in to show off a few of our new features 2012-05-17 19:37:03 -07:00
ridiculousfish
f5442bdd4a Fixed cd autosuggestion for absolute paths
Removed some unnecessary path cleanup that is_potential_path now handles
2012-05-13 20:49:14 -07:00
ridiculousfish
129525af21 Fix for https://github.com/ridiculousfish/fishfish/issues/3
cd's special autosuggestion was broken, now fixed. Also, there's some tests for it now.
2012-05-13 20:19:02 -07:00
ridiculousfish
c15975113a Fix for https://github.com/ridiculousfish/fishfish/issues/2 2012-05-11 18:59:38 -07:00
ridiculousfish
2d3d6e1c17 Added PackageMaker file
Updated make_pkg.sh to use it
2012-05-11 17:26:08 -07:00
ridiculousfish
b0f4ff2879 Added build_tools folder so we can automate release builds 2012-05-10 02:11:28 -07:00
ridiculousfish
070b10689c Added .gitattributes to ignore new build_tools directory from archival 2012-05-10 02:10:39 -07:00
ridiculousfish
39863ce4d7 Fix for longstanding bug where set -e would fail to erase elements from an array.
This was introduced in 7b3377e78c
2012-05-10 01:04:18 -07:00
ridiculousfish
7cae1ae415 Make key_reader build and work 2012-05-09 03:30:09 -07:00
ridiculousfish
eca2100312 Cleanup SHLVL variable 2012-05-09 03:23:31 -07:00
ridiculousfish
175249b455 Adopt wcstring in env_set 2012-05-09 03:06:10 -07:00
ridiculousfish
294fbc8309 Replaced some calls to unescape with unescape_string 2012-05-09 02:55:36 -07:00
ridiculousfish
9bcc7df96f Lots of modernization changed
Removed wcsdupcat
2012-05-09 02:33:42 -07:00
ridiculousfish
4bd63020ca Fix to add a little explanatory text to colors in the web config interface 2012-05-08 17:10:38 -07:00
ridiculousfish
4885842ae8 Fix to do really nice syntax highlighting of cd command where it colors paths that cannot match any directory with error color 2012-05-07 17:52:02 -07:00
ridiculousfish
4df6b599b8 Eliminate the silly autosuggest_parsed_command_t class; make it just a function 2012-05-07 17:43:05 -07:00
ridiculousfish
0c79bb6e7c Factor is_potential_path to properly handle CDPATH
This will let us color cd commands better
2012-05-07 17:31:24 -07:00
ridiculousfish
1a264ab7c2 Made tests compile again
Renamed autosuggest_handle_special to autosuggest_special_validate_from_history
Began work to factor autosuggest_special_validate_from_history together with autosuggest_suggest_special
2012-05-07 12:55:13 -07:00
ridiculousfish
99b51ce6ea Fix to better support CDPATH 2012-05-06 14:53:19 -07:00
ridiculousfish
e0baab2722 Another effort to make the cd completion work without running command substitutions off of the main thread 2012-05-06 13:51:11 -07:00
ridiculousfish
71a8d39372 Fix to restore completions that use command substitution (like cd)
Fix to adopt the same escaping code for both completions and autosuggestions
2012-05-06 13:36:51 -07:00
ridiculousfish
90826e4031 Oops, had the wrong sense for when to call proc_push_interactive 2012-05-05 14:39:08 -07:00
ridiculousfish
0e4f2cca01 Fix to stop setting a default CDPATH 2012-05-05 14:34:59 -07:00
ridiculousfish
ac3dce38f0 Better fix to make cd completions work again 2012-05-05 14:33:24 -07:00
ridiculousfish
3be07cc645 Fix to start re-respecting CDPATH 2012-05-05 14:30:20 -07:00
ridiculousfish
07f5319472 Fix for failing to properly complete cd command 2012-05-05 14:21:21 -07:00
ridiculousfish
47019e315a Some work towards refactoring how completions are inserted to support escaping in autosuggestions 2012-05-05 13:34:09 -07:00
ridiculousfish
fe7fa46d57 Make dirh, nextd, prevd work on OS X 2012-05-04 18:53:38 -07:00
ridiculousfish
007c5bc9f0 Workaround difference between BSD and GNU seq in dirh
dirh still doesn't make any sense
2012-05-04 18:37:24 -07:00
ridiculousfish
8c423b56df Define a virtual destructor for lru.h 2012-05-04 18:37:12 -07:00
ridiculousfish
a868abb55a Minor cleanup of proc.cpp 2012-04-25 13:38:40 -07:00
ridiculousfish
ecab34c787 Make gettext function use echo instead of printf to save a fork 2012-04-25 13:37:41 -07:00
ridiculousfish
307ea6dce2 Removed extra newline from Goodbye output 2012-04-25 13:37:01 -07:00
ridiculousfish
d456b4f68e Removed useless deroff.py import from bash settings 2012-04-25 13:36:21 -07:00
ridiculousfish
17e815348b Fix to drain command output from quit commands before returning from job_continue
This should fix the bug where output from commands and builtins gets incorrectly interleaved.
I think this is a very long-standing bug that predates my work on the shell
2012-04-25 13:26:56 -07:00
ridiculousfish
953ab4b3cf Clean up __fish_config_interactive a little bit 2012-04-24 11:12:04 -07:00
ridiculousfish
9204780c1b Fix for a missing lock in complete_remove 2012-04-24 11:01:04 -07:00
ridiculousfish
fb2ed355ec Improve fork reporting
Save a couple of forks during init
2012-04-24 10:10:43 -07:00
ridiculousfish
675106cfa5 Include algorithm header so we can build on Linux 2012-04-23 19:29:44 -07:00
ridiculousfish
3aeadd9fb7 Fix for a deadlock when env_get_string ends up calling env_get_string 2012-04-23 11:08:29 -07:00
ridiculousfish
0e3eb38f11 Improved fork reporting
Made autosuggestion work properly for tilde expansion
2012-04-21 20:08:44 -07:00
Siteshwar Vashisht
dc23af6b32 Fixed setting PATH variable in import_bash_settings.py 2012-04-22 00:18:40 +05:30
ridiculousfish
b1bfa71338 Merge branch 'master' into CPlusPlus
Conflicts:
	builtin_commandline.cpp
	util.c
2012-04-18 13:41:39 -07:00
ridiculousfish
71bff26607 Merge remote-tracking branch 'upstream/master' 2012-04-18 13:21:03 -07:00
ridiculousfish
3c190374b4 Wrote tests for history merging, then made them pass. 2012-04-16 20:26:50 -07:00
ridiculousfish
d8428463d8 Fix to better handle merging histories between separate sessions 2012-04-15 22:49:27 -07:00
ridiculousfish
725982cc5b Fix to try to remove Python 2.7 dependency 2012-04-15 19:45:44 -07:00
ridiculousfish
f977dfcfe7 Deroffer optimizations 2012-04-15 19:22:30 -07:00
ridiculousfish
15079fa3bd Some more deroff optimizations 2012-04-15 04:41:20 -07:00
ridiculousfish
79a92120ef Speed improvements to deroffer 2012-04-15 01:15:10 -07:00
ridiculousfish
a34565ca0f Make screen.cpp properly compute the length of term256 escape codes 2012-04-13 14:40:16 -07:00
ridiculousfish
49ece586d5 Added a fish_update_completions function to run the manpage completion file
Added some pretty progress reporting to that script
Added some comments to deroff.py
2012-04-11 19:05:43 -07:00
ridiculousfish
2ec0778d78 Make create_manpage_completions output to ~/.config/fish/completions by default, and also discover man pages from reading the manpath 2012-04-11 18:26:26 -07:00
ridiculousfish
cccd1cefbe Make the web config page have a title and pass W3C validation 2012-04-11 18:26:10 -07:00
ridiculousfish
8f145fa7fa Fix for complete.cpp to print out completions in-order 2012-04-11 18:25:37 -07:00
ridiculousfish
ceb32f63e7 Deroffing completion work 2012-04-09 20:17:54 -07:00
ridiculousfish
576c12b184 Deroffer work 2012-04-09 20:17:54 -07:00
ridiculousfish
e2c3ca9950 Move completions from linked list to std::set 2012-04-09 20:17:06 -07:00
ridiculousfish
8585e0e9b8 Various improvements on completion tool 2012-04-04 12:43:12 -07:00
ridiculousfish
7394374a15 Work on improving the output of the manpage completion script 2012-04-03 18:38:25 -07:00
ridiculousfish
37defa739b Fix for an extra line at the end of the variable listing
Once again, fix the issue where some color cells aren't clickable
2012-04-01 01:31:38 -07:00
ridiculousfish
51ed3fbc4b More work to try to make webconfig's layout correct under firefox 2012-04-01 00:53:53 -07:00
ridiculousfish
ab78075d06 Default all xterms into term256 2012-04-01 00:53:47 -07:00
ridiculousfish
52070ea577 Fix to properly update colors for non-native term256 support 2012-03-31 17:24:11 -07:00
ridiculousfish
f930303d3e Fix for an issue where you can't select the top row of colors 2012-03-31 15:38:30 -07:00
ridiculousfish
268fb37517 Cleanup proc_had_barrier
Ensure we don't try to do a universal barrier off of the main thread
2012-03-31 15:33:34 -07:00
ridiculousfish
ff17101316 A little better support for non-term-256 colors in web config
Fix for a deadlock when autoloading a function triggers autoloading another function
2012-03-31 15:17:14 -07:00
ridiculousfish
ab536e5199 Fix for incorrectly highlighted parameters 2012-03-31 14:05:14 -07:00
ridiculousfish
c10b3017d6 Improve autosuggesting of cd command 2012-03-30 11:16:24 -07:00
ridiculousfish
0f63e1f988 Some work towards improving manpage completions 2012-03-30 10:00:01 -07:00
ridiculousfish
3bb537c183 Fix for failing to highlight last quote (or quoted string contents) 2012-03-30 09:58:25 -07:00
ridiculousfish
ff23bf6f0c Fix for bug where fish would not autosuggest certain executables 2012-03-27 19:22:33 -07:00
ridiculousfish
00d3e18780 Fix compile error (oops) 2012-03-27 19:10:21 -07:00
ridiculousfish
a62f300753 Make the color picker cell borders appear correctly in Firefox 2012-03-27 19:00:03 -07:00
ridiculousfish
0bc644abf0 Fix lots of bugs related to the static analyzer
Improved how screen.cpp interacts with output_set_writer()
2012-03-26 01:21:10 -07:00
ridiculousfish
31b7d076b7 Remove some dead variables.
Fix screwy output for invalid tilde expansion in expand.cpp
Some cleanup per clang static analyzer
2012-03-25 23:31:03 -07:00
ridiculousfish
a11687fc5c Make the functions builtin have a bit nicer output
Stop autosuggesting things with newlines
Make webconfig a little nicer
2012-03-25 22:41:22 -07:00
ridiculousfish
fa346cec3b Moved some Python scripts into new share/tools/ directory.
Added fish_config function to launch web config
2012-03-25 18:38:33 -07:00
ridiculousfish
0bdf7a598a More work on web_config 2012-03-25 16:00:17 -07:00
ridiculousfish
0c9a1a56c2 Lots of work on web config
Change to make fish immediately show color changes
2012-03-25 16:00:17 -07:00
ridiculousfish
c0655b6b08 Web config 2012-03-25 16:00:17 -07:00
Siteshwar Vashisht
dca9b83ec0 Enclose descriptions inside double quotes, and escape any enclosed double quotes. 2012-03-23 21:34:52 +05:30
Siteshwar Vashisht
7ded90ae6a Add trimmed descriptions with complete command while parsing man pages. 2012-03-22 23:41:36 +05:30
Peter Ammon
a6ab66080e Additional tweak to color order 2012-03-20 11:33:44 -07:00
Siteshwar Vashisht
89e1cad470 Append $argv only to the last command in an alias. 2012-03-20 22:07:34 +05:30
Peter Ammon
e55bc92d1f Tweak the color order 2012-03-20 03:05:00 -07:00
Peter Ammon
d6a59b538f Work on web config color ordering 2012-03-20 03:01:00 -07:00
ridiculousfish
1a87f44325 Re-implement $history variable
Added -L option to set to mean "don't abbreviate"
2012-03-19 11:52:18 -07:00
ridiculousfish
c8bc535f22 Big improvement to web config history speed
Nice dashed table seprators
2012-03-19 11:51:44 -07:00
Peter Ammon
1889db3263 web_config work 2012-03-19 00:03:38 -07:00
Siteshwar Vashisht
73b88f2304 Added method to find a character outside quotes in a string. 2012-03-18 15:14:34 +05:30
Siteshwar Vashisht
21b8e5a5c6 Some additions to make scripted aliases work 2012-03-18 15:00:27 +05:30
ridiculousfish
b1ff14162f More work on web config 2012-03-16 17:21:37 -07:00
Peter Ammon
c6c55823ac More work on web config 2012-03-16 03:05:51 -07:00
ridiculousfish
8b8a970098 Made builtin_test handle parenthesis 2012-03-15 20:40:57 -07:00
Siteshwar Vashisht
ebfcee6e67 Fixed a crash on inputs like ls x>| less, where x doesn't exist in current directory. 2012-03-16 00:34:09 +05:30
Peter Ammon
63b330439e Initial work towards web config UI 2012-03-15 03:43:45 -07:00
ridiculousfish
52d8fb301c Added term256 support to set_color tool 2012-03-13 14:23:10 -07:00
Siteshwar Vashisht
dfe159e719 Fixed a crash on Linux caused while inserting \ in quotes. 2012-03-13 05:39:17 +05:30
Siteshwar Vashisht
4e7e45a431 Adding scripts to import aliases, environment variables and prompt from bash. 2012-03-11 22:46:58 +05:30
ridiculousfish
d81bd296fc Tweak rgb_color_t back down to 4 bytes 2012-03-10 16:15:56 -08:00
ridiculousfish
6d3f257439 Shortened the "no matches found" error message 2012-03-10 13:44:35 -08:00
ridiculousfish
f92b24221a Made pwd a builtin
Fixed a thread error when autosuggesting with a command substitution
2012-03-09 20:16:26 -08:00
ridiculousfish
afd78f3f0b Allow g_log_forks to be set by fish_log_forks env var 2012-03-09 11:56:33 -08:00
ridiculousfish
44f3f51e0d Attempt to not fork just to output the result of simple builtins. I'm unsure of why this was necessary, if it ever was. 2012-03-09 11:49:29 -08:00
ridiculousfish
14a35e7c21 Flip the switch to stop draining threads before exec (!) 2012-03-09 11:28:24 -08:00
ridiculousfish
d173bb6e0a A bunch of changes working towards eliminating all memory allocation after fork() 2012-03-08 23:21:07 -08:00
ridiculousfish
ce859c9e92 Added some missing calls to setup_fork_guards() in utilities.
Made echo a builtin
2012-03-07 11:35:22 -08:00
ridiculousfish
8ed20f3c28 Removed pwd.fish, which made the home directory print out with ~ (annoying) 2012-03-07 10:53:08 -08:00
ridiculousfish
0ced7d8e56 Improve error reporting for builtin_test 2012-03-07 01:16:50 -08:00
ridiculousfish
143ead8d00 Fix builtin_test to properly handle last expression in a combining expression 2012-03-07 01:13:24 -08:00
ridiculousfish
6788c2710f Improved error reporting for builtin_test 2012-03-07 01:02:46 -08:00
ridiculousfish
ed7c10f366 Implemented test as a builtin (!) 2012-03-07 00:54:01 -08:00
ridiculousfish
68b93c624f Move special handling of DISPLAY environment variable from etc/config.fish to fish itself to reduce number of fork calls made at launch 2012-03-06 15:52:16 -08:00
ridiculousfish
36fe1e4a46 Some initial work towards cutting down the number of fork calls we do 2012-03-06 15:12:37 -08:00
ridiculousfish
9ee4e4e05c Tweak fork guards to use getpid() instead of pthread_atfork 2012-03-06 14:34:18 -08:00
ridiculousfish
ea65a0c519 Updated a comment 2012-03-06 14:32:00 -08:00
ridiculousfish
f35d2629d4 Notice when fish_term256 changes and react to it 2012-03-05 14:18:16 -08:00
ridiculousfish
0e5578204e Additional work towards "forcing" term256 mode on supported terms 2012-03-05 13:39:01 -08:00
ridiculousfish
063a465227 Begin to rework term256 support 2012-03-05 10:44:08 -08:00
ridiculousfish
230fb921ec We had identical format_val and to_string; standardize on to_string 2012-03-05 10:18:42 -08:00
ridiculousfish
82a93d8406 Fix for completions only printing one item 2012-03-05 10:03:26 -08:00
ridiculousfish
2dda8634e9 Fix to stop autosuggesting on whitespace 2012-03-05 09:34:54 -08:00
Siteshwar Vashisht
2f313b799a Made fish_tests.cpp compile on Linux. 2012-03-05 21:57:31 +05:30
ridiculousfish
d371256913 Fix for crash on "less test <tab>" 2012-03-04 18:11:21 -08:00
Siteshwar Vashisht
a7ec93b287 Fixed compilation on Linux. 2012-03-04 16:57:41 +05:30
ridiculousfish
2c5001a5b3 Removed buffer_t 2012-03-04 02:45:51 -08:00
ridiculousfish
191221eec5 Final cleanup of io_data_t now that I recognize the bizarre way in which it shares output buffers (not sure how this ever worked before) 2012-03-04 02:35:30 -08:00
ridiculousfish
27f374a38b Some initial work on removing buffer_t from io_data_t 2012-03-03 23:56:35 -08:00
ridiculousfish
baa813c46f Fix for history being saved too often 2012-03-03 23:10:15 -08:00
ridiculousfish
79a22b1f8d Replace some string_buffer_t 2012-03-03 23:01:42 -08:00
ridiculousfish
087940ec9e Fix a bug where wfopen would always fail
Removed some buffer_t
2012-03-03 22:48:21 -08:00
ridiculousfish
8a46931e34 Remove string_buffer_t (!) 2012-03-03 22:08:34 -08:00
ridiculousfish
a9313fc0c3 Cleanup reader.cpp's usage of string_buffer, remove some other unused data structures 2012-03-03 21:59:45 -08:00
ridiculousfish
dfba35aee8 Clean up the kill ring 2012-03-03 21:46:06 -08:00
ridiculousfish
5ae77b4317 For for crash when typing backslash c 2012-03-03 20:38:16 -08:00
ridiculousfish
a0bb2cdc6e removed some string_buffer 2012-03-03 19:37:55 -08:00
ridiculousfish
0a5680c3e8 Rewrite vformat_string to not use string_buffer 2012-03-03 19:12:06 -08:00
ridiculousfish
00764406d7 Fix to preserve errno across certain calls to stop printing EOVERFLOW messages in weird places 2012-03-03 15:28:16 -08:00
ridiculousfish
3ead99b088 Put fish on a diet. Tracked down the biggest memory hogs and fixed them. Total allocations down by a factor of 3 or so, live allocations a few KB. 2012-03-03 15:22:03 -08:00
Siteshwar Vashisht
8c0803e3c5 Setting cdpath to current directory in path.cpp. 2012-03-04 01:28:09 +05:30
ridiculousfish
2da8df6202 Rearrange wopen and stat to avoid a race and hopefully improve performance a little bit. 2012-03-02 11:12:08 -08:00
ridiculousfish
17a75a5aa5 Change to detect and use O_CLOEXEC 2012-03-02 09:58:29 -08:00
Peter Ammon
8b26d0104c Some initial changes to use CLO_EXEC, with an eye towards some day using it correctly. 2012-03-02 00:27:40 -08:00
ridiculousfish
36622c3578 Fix to properly handle case insensitive autosuggestions 2012-03-01 17:31:45 -08:00
ridiculousfish
fd4df6f9bb Changed iterators from iter++ to ++iter
Large set of changes to history to ensure that histories from other sessions don't "bleed" into the current session
2012-03-01 14:56:34 -08:00
ridiculousfish
5d18d60e3b Squash some leaks 2012-02-29 18:09:20 -08:00
ridiculousfish
e4d98597c7 Added some fork tests, fixed some bugs it found 2012-02-29 17:55:50 -08:00
ridiculousfish
72da14e414 Fix a leak 2012-02-29 17:55:28 -08:00
ridiculousfish
8ada404c5f More work towards improving relationship between multithreading and fork 2012-02-29 16:14:51 -08:00
ridiculousfish
ebba30d671 Fix a "class <-> struct" warning with clang++ 2012-02-29 16:14:51 -08:00
ridiculousfish
909d24cde6 More work on improving interaction between fork and pthreads. Added null_terminated_array_t class. 2012-02-29 16:14:51 -08:00
ridiculousfish
4e912ef83d Added postfork 2012-02-29 16:14:51 -08:00
ridiculousfish
b17dfff3fd Fix for out-of-bounds write in highlight_param 2012-02-29 16:14:03 -08:00
ridiculousfish
52dc415d0b Fix to add a generation count to threaded operations so they abort early 2012-02-28 12:40:59 -08:00
Siteshwar Vashisht
392232246e Fixed compilation on Linux with some minor changes. 2012-02-28 21:20:09 +05:30
ridiculousfish
cf54ad8242 Change to wait for all outstanding iothreads before calling fork(). This should prevent a whole host of threading/fork interactions, but may also compromise performance...we'll see. 2012-02-27 19:46:15 -08:00
ridiculousfish
fdfa5c0602 Some initial work towards resolving nasty fork/pthread issues, and to having a per-parser job list 2012-02-27 18:43:24 -08:00
ridiculousfish
50ee5d28cd Fix to finally turn on multithreaded completions for autosuggestion 2012-02-27 15:33:46 -08:00
ridiculousfish
f74a82776f Some more changes in preparation for turning on complete-based autosuggestions 2012-02-26 20:11:34 -08:00
ridiculousfish
3553e65089 Add some more locking and const correctness to completion_entry_t in preparation for supporting better multithreading 2012-02-26 14:32:06 -08:00
ridiculousfish
ad7c5886bc Fix a crash in complete -C 2012-02-26 13:46:21 -08:00
ridiculousfish
b30090f946 Some cleanup of completions in preparation for more multithreading 2012-02-26 13:27:31 -08:00
ridiculousfish
8f637975a4 Temporarily disable background completions 2012-02-26 12:16:22 -08:00
ridiculousfish
94a764d6ea Fix for error messages when loading completions 2012-02-26 01:15:53 -08:00
ridiculousfish
38e40862fe More work towards autosuggesting completions 2012-02-25 18:54:49 -08:00
ridiculousfish
5ea78f55f2 Some more work on threaded completions 2012-02-24 18:43:10 -08:00
ridiculousfish
a515db4aea Some work to allow completions to be evaluated off of the main thread 2012-02-24 12:19:31 -08:00
ridiculousfish
90e979d0d9 Added some const correctness 2012-02-24 09:33:30 -08:00
Siteshwar Vashisht
8232857d07 Modified env_get_string() to accept wcstring instead of wchar_t*. 2012-02-24 00:58:01 +05:30
ridiculousfish
2ae56564ef Changes to block signals for a smaller time interval during saving 2012-02-23 10:49:30 -08:00
ridiculousfish
f24a0170be Fix for failing to unescape history properly, resulting in a backslash explosion 2012-02-23 10:29:42 -08:00
Siteshwar Vashisht
fd56465931 Fixed initialization of va_list variable in debug() in common.cpp, and mismatched new/free() in io.cpp 2012-02-23 23:10:51 +05:30
ridiculousfish
376e199ebb Removed a lot of string_buffer_t 2012-02-22 12:00:02 -08:00
ridiculousfish
a837a27b34 Replace some string_buffer_t with wcstring 2012-02-22 11:07:34 -08:00
ridiculousfish
62bd43f17f Large set of changes to migrate sb_out and sb_err to wcstring 2012-02-22 10:51:06 -08:00
ridiculousfish
917b4ff8bc Fix for crash on redirections 2012-02-21 19:39:29 -08:00
ridiculousfish
5fe7c065dc Squash a bunch of leaks 2012-02-21 19:33:11 -08:00
ridiculousfish
e074ad4807 Removed a leaking wcsdup 2012-02-21 18:18:10 -08:00
ridiculousfish
5f3fe4acff Removed an optimization obviated by our use of wcstring from env.cpp 2012-02-21 18:12:51 -08:00
ridiculousfish
4ccc197451 Fix to change highlighting functions to take wcstring& instead of const wchar_t * 2012-02-21 17:55:56 -08:00
ridiculousfish
237cf19a77 Switch to using std::vector instead of int* for colors in highlight.cpp, for better range bounds checking 2012-02-21 11:45:13 -08:00
ridiculousfish
2206e221bd Removed array_list_t (!) 2012-02-21 10:47:21 -08:00
ridiculousfish
d9bb9b73ad Change to allow building without doxygen 2012-02-20 16:18:10 -08:00
ridiculousfish
d5c382bb1a Piling on more code to make autosuggestion try to guess directories even when they're not in the history 2012-02-20 02:13:31 -08:00
Peter Ammon
52daf6cf41 Fix to allow color.cpp to use fallback wcscasecmp 2012-02-19 11:07:02 -08:00
Siteshwar Vashisht
74a7303c23 Modified functions in function.h/.cpp to use wcstring instead wchar_t*, other files also modified to use wcstring. 2012-02-19 22:55:15 +05:30
ridiculousfish
d8a9991738 Fix to avoid calling signal_block off of hte main thread 2012-02-18 23:26:39 -08:00
ridiculousfish
ca1c8243c8 Fix to prevent autosuggesting cd'ing to the current working directory 2012-02-18 21:56:30 -08:00
ridiculousfish
14b3a5be56 Changes to make autosuggestion even smarter by specially recognizing the cd command. 2012-02-18 18:54:36 -08:00
ridiculousfish
ed89df7e9d Some minor cleanup of reader.cpp in preparation to unify highlighting with autosuggestion 2012-02-18 18:51:11 -08:00
ridiculousfish
1bedc16544 Enhanced directory detection in a way we don't actually need yet 2012-02-18 18:51:11 -08:00
ridiculousfish
ac0b97a571 Squash some warnings 2012-02-18 18:49:55 -08:00
Siteshwar Vashisht
7b3d670e23 Removing some unnecessary calls to c_str(), and added str2wcstring(std::string) in common.cpp. 2012-02-18 23:28:54 +05:30
Siteshwar Vashisht
c9f4e91df8 Modified most functions in wutil.h/.cpp to use wcstring instead of wchar_t*, removing calls to c_str() while calling these functions in other files. 2012-02-18 22:41:22 +05:30
Siteshwar Vashisht
c0ed169fdc Getting rid of hash_table_t and it's helper functions completely. Bye bye hash_table_t ! 2012-02-18 21:21:10 +05:30
Siteshwar Vashisht
412894bfc8 Removed tests for hash_table_t from fish_tests.cpp 2012-02-18 21:04:09 +05:30
Siteshwar Vashisht
aad6e5648b Fix for properly removing universal variable. 2012-02-18 14:42:02 +05:30
ridiculousfish
8f1423946f Fix a crash when using quotes due to wgettext thread safety issues. 2012-02-17 15:55:54 -08:00
ridiculousfish
51da4856e2 Squash a leak in LRU caches 2012-02-17 14:54:58 -08:00
ridiculousfish
3b56c58f00 Fix for crash in env.cpp where a deleted entry was not removed from the map 2012-02-17 12:23:30 -08:00
ridiculousfish
4fd2531302 Fix to properly null-terminate export list 2012-02-17 11:42:53 -08:00
ridiculousfish
fdef238a83 Fix to stop spamming console with event messages (oops) 2012-02-17 11:40:26 -08:00
ridiculousfish
9787901ddb Fix for removing too many event handlers (that's why "Goodbye" never got printed") 2012-02-17 11:37:25 -08:00
Siteshwar Vashisht
6e58c9f7c8 Switched to std::map instead of hash_table_t in env.cpp and env_universal_common.cpp. 2012-02-18 00:25:29 +05:30
ridiculousfish
a08450bcb6 Changes to make autosuggestion smarter about not suggesting commands that could never succeed. 2012-02-16 00:24:27 -08:00
ridiculousfish
a92d9d442b Initial work towards making autosuggestion smarter by recognizing paths 2012-02-15 11:33:41 -08:00
ridiculousfish
e2ff77b4ec Clean up make_path and some memory allocations 2012-02-13 22:44:29 -08:00
ridiculousfish
caf7a93382 Fix for busted completions (tab completion of directories was failing) 2012-02-13 22:37:09 -08:00
ridiculousfish
afcda2f724 Fix a leak 2012-02-13 19:39:20 -08:00
ridiculousfish
fcea723aa7 Fixed parenthesis causing a crash or bizarre layout. 2012-02-13 17:15:41 -08:00
ridiculousfish
faf80588ab Fix for busted directory check 2012-02-13 16:38:35 -08:00
ridiculousfish
fc589611e2 Attempt to make fish_pager.cpp compile on Linux 2012-02-13 14:25:07 -08:00
ridiculousfish
5ecd350311 Another attempt to make mimedb.cpp compile on Linux 2012-02-13 14:22:07 -08:00
ridiculousfish
4b6c6c59b5 Squash warnings in mimedb, hopefully get it compiling on Linux 2012-02-13 12:14:26 -08:00
ridiculousfish
0f8ffa6226 For for crash printing backtrace for command "eval cd sldkfjsdlfk" 2012-02-13 11:55:02 -08:00
ridiculousfish
6def61dfe9 A bit more debugging to parser class to try to track down a crash 2012-02-13 11:42:58 -08:00
ridiculousfish
b39bebee06 Fix for problem where we'd never use a cached placeholder function. Also upped the staleness interval from its testing value of 1 to 15 seconds. 2012-02-13 10:28:04 -08:00
ridiculousfish
dce189fc6d Support for setting both RGB and named colors on the same line, so the same config can work for multiple term types 2012-02-13 09:52:17 -08:00
ridiculousfish
0a4c72e78b Added color.h, color.cpp. Got term256 colors working. 2012-02-12 18:05:59 -08:00
ridiculousfish
d66700a0e4 Color work 2012-02-11 17:07:56 -08:00
ridiculousfish
b59a22bef0 Colors 2012-02-10 17:57:20 -08:00
ridiculousfish
9b1930588f Migrate errors from array_list_t to wcstring_list_t 2012-02-10 17:54:38 -08:00
Siteshwar Vashisht
18bb64cd43 Fixed compilation with recent changes on Linux. 2012-02-10 21:25:06 +05:30
ridiculousfish
d975187433 Removed some al_list functions 2012-02-10 01:37:30 -08:00
ridiculousfish
910863e9ea Final removal of halloc. It's like Christmas Morning. 2012-02-09 19:26:44 -08:00
ridiculousfish
a38490429b Removed a halloc_register_function_void 2012-02-09 19:00:05 -08:00
ridiculousfish
80e8f6a0d1 Removed halloc_wcsdup 2012-02-09 18:59:15 -08:00
ridiculousfish
e5ff5f7484 Some hopefully good changes to get IOs off of halloc 2012-02-09 18:43:36 -08:00
ridiculousfish
646240fc54 Changed the Makefile to no longer fail if man pages are missing, etc. 2012-02-09 16:36:35 -08:00
ridiculousfish
19cd7a248d Cleanup of wildcard.cpp, removing ad-hoc hash table and halloc 2012-02-09 16:06:24 -08:00
ridiculousfish
f1b1d1ca75 Get rid of some string buffer 2012-02-09 10:14:06 -08:00
ridiculousfish
e5bba2294d Removed some more halloc 2012-02-09 02:01:49 -08:00
ridiculousfish
19cfd9b5d6 Fix for pager regression 2012-02-09 01:54:46 -08:00
ridiculousfish
7e1b15a0cc More changes to fish pager to fix regressions. It didn't actually work. 2012-02-09 01:39:08 -08:00
ridiculousfish
19858c574d Removed halloc and al_list from fish_pager. paging still seems to work 2012-02-09 01:02:12 -08:00
ridiculousfish
f891ea5713 Fixed named_arguments to be wcstring_list_t instead of al_list 2012-02-08 23:53:23 -08:00
ridiculousfish
d3311c81e5 REmoved al_list from exec.cpp 2012-02-08 22:56:42 -08:00
ridiculousfish
b6bc4381fb Get event_t off of halloc (!) 2012-02-08 19:02:25 -08:00
ridiculousfish
b3d0561c09 Cleanup event_get_desc 2012-02-08 16:20:48 -08:00
ridiculousfish
1bbe901bcd Eliminated halloc usage from complete.cpp 2012-02-08 16:15:53 -08:00
ridiculousfish
4f8b4379f5 Cleanup of completion_entry in complete.cpp 2012-02-08 14:48:22 -08:00
Siteshwar Vashisht
bc8a288386 Got rid of multiple cd paths, only current directory will be searched while changing directories, implicit cd (entering directory just by typing it's name) is removed. 2012-02-09 01:18:51 +05:30
ridiculousfish
3dc56de0ae Excised some more halloc and array_list_t 2012-02-08 02:34:31 -08:00
ridiculousfish
b2e5809180 Removed halloc from highlight.cpp 2012-02-08 02:13:39 -08:00
ridiculousfish
7e52523541 Migrate mimedb off of al_init 2012-02-08 01:55:35 -08:00
ridiculousfish
8bc83c5967 Removed al_list from mimedb.cpp 2012-02-08 01:22:08 -08:00
ridiculousfish
029c8c06c2 Remove old env_get_names implementation 2012-02-08 00:59:46 -08:00
ridiculousfish
063fc0c48b Cleanup al_list from builtin_complete.cpp 2012-02-08 00:45:07 -08:00
ridiculousfish
191eeab589 Cleanup expand_escape_variable 2012-02-08 00:15:06 -08:00
ridiculousfish
3f8621e566 CLeanup the io_stack in builtin.cpp, other changes to migrate away from al_list 2012-02-07 23:53:34 -08:00
ridiculousfish
5f686ebb47 Clean up exec_subshell, removing al_list from it 2012-02-07 23:35:41 -08:00
ridiculousfish
6a31457c6d Really excise halloc from input.cpp 2012-02-07 23:17:20 -08:00
ridiculousfish
e6f7912a25 Removed halloc from input.cpp 2012-02-07 23:15:32 -08:00
ridiculousfish
8a2737566c Excised some more halloc 2012-02-07 22:44:10 -08:00
ridiculousfish
006523ac59 Replaced void*data with auto_ptr<function_data_t>, eliminating antoher halloc. 2012-02-07 22:10:35 -08:00
ridiculousfish
c0e783eb6e Excised some halloc 2012-02-07 21:23:12 -08:00
ridiculousfish
399c78fbf7 Fix event_block_t list from ad-hoc linked list to std::dequeue 2012-02-07 21:04:51 -08:00
ridiculousfish
a0a43046b3 Removed discriminated union from block_t type, allowing us to store wcstrings in it 2012-02-07 17:36:54 -08:00
Siteshwar Vashisht
e8af86017a Fixed a bug caused while highlighting double quoted strings. For e.g. ls "abc" shows up as invalid write for color of closing quote in valgrind. 2012-02-07 21:37:53 +05:30
ridiculousfish
382ffe9b6a Added autosuggestion color variable fish_color_autosuggestion
Fixed that nasty bug where fish would apply a color to both the foreground and background (yuck)
2012-02-06 20:14:19 -08:00
ridiculousfish
e5b34d5cd5 Suppress autosuggesting during backspacing like browsers do 2012-02-06 19:31:06 -08:00
ridiculousfish
0dba7b3313 Use right arrow to accept autosuggestions 2012-02-06 11:59:34 -08:00
ridiculousfish
27f2859258 Make history searching skip the autosuggestion 2012-02-06 11:52:24 -08:00
ridiculousfish
eeed45da0f Fix some bugs related to not updating our buffer size as our command line changes 2012-02-06 11:34:49 -08:00
ridiculousfish
067dff8489 Initial stab at autosuggestions 2012-02-06 10:52:13 -08:00
ridiculousfish
7d3151191d Removed builtin_scripts.h and builtin_scripts.cpp from Xcode project because they're annoying in searches 2012-02-06 10:47:55 -08:00
ridiculousfish
98fa1325f5 insert_str -> insert_string 2012-02-06 02:20:50 -08:00
ridiculousfish
bd45b79ed8 Removed buff_len field. One fewer field, hooray. 2012-02-06 01:53:03 -08:00
ridiculousfish
0a616a9dbb Large set of changes to migrate reader_data_t's buffer to std::wstring 2012-02-06 01:45:16 -08:00
ridiculousfish
a534c397f5 Const correctness changes 2012-02-06 00:57:43 -08:00
ridiculousfish
737589ec01 Removed lru.cpp (double oops) 2012-02-06 00:53:08 -08:00
ridiculousfish
a7f8ee90c0 Added LRU.cpp (oops) 2012-02-06 00:52:22 -08:00
ridiculousfish
b14683200a Change the history so that when you go forwards, it no longer highlights 2012-02-05 23:22:18 -08:00
ridiculousfish
c82410bfda Fixed history tests 2012-02-05 22:48:43 -08:00
ridiculousfish
00ad837eb4 Final cleanup of history 2012-02-05 22:30:42 -08:00
ridiculousfish
9ab54030b9 Moved LRU to its own file 2012-02-05 20:54:41 -08:00
ridiculousfish
5ad6849d4e Work on new history implementation 2012-02-05 16:42:24 -08:00
ridiculousfish
7fcf25a78f Removed the "don't highlight with stale data" code, that caused "flashing" as we typed 2012-02-03 20:06:48 -08:00
ridiculousfish
5c205c43d1 Fix to highlight search results range matching again 2012-02-03 20:05:50 -08:00
ridiculousfish
f20f49d872 Migrate search_buff to wcstring 2012-02-03 20:01:01 -08:00
ridiculousfish
fb63c3908c Minor cleanup of background_highlight_context_t 2012-02-03 18:39:41 -08:00
ridiculousfish
623eb42a6a CLean up current_filename, make it a std::stack 2012-02-02 15:05:08 -08:00
ridiculousfish
6afc06b97e Migrate some al_list to std::vector 2012-02-02 14:27:13 -08:00
ridiculousfish
cdd5b1ed26 Fixed a crash doing completion of commands 2012-02-02 14:11:20 -08:00
ridiculousfish
884b4026dd Cleanup complete_cmd_desc 2012-02-02 12:04:04 -08:00
ridiculousfish
62f49c55ce Clean up uses of completion_t 2012-02-01 16:27:14 -08:00
ridiculousfish
0b4b6c498d Migrated off of old variant of expand_one that used halloc 2012-01-31 21:30:09 -08:00
ridiculousfish
409f70c7f3 Remove some old functions from expand.cpp that now have modern replacements 2012-01-31 21:09:11 -08:00
ridiculousfish
bb19fe703a Fixup wsetlocale to use wcstring 2012-01-31 21:06:52 -08:00
ridiculousfish
eef1e3e77e More cleanup of static string buffers in favor of wcstring 2012-01-31 20:22:25 -08:00
ridiculousfish
562ba1291e Stop using placement new like a weirdo 2012-01-31 20:03:48 -08:00
ridiculousfish
3adf6d25f6 Cleanup of builtins. No more hashes. 2012-01-31 19:47:56 -08:00
ridiculousfish
beece6a828 Clean up how argv is stored in process_t 2012-01-31 18:06:20 -08:00
ridiculousfish
207ab2aa5b Squashed all known remaining leaks! 2012-01-31 17:06:47 -08:00
ridiculousfish
4ccc2550d0 Squash a bunch of warnings 2012-01-31 17:01:19 -08:00
ridiculousfish
0c9e398bef Change parser_t::parse_job's args array to be a local, rather than just leak it, which no longer seems to crash 2012-01-31 16:50:03 -08:00
ridiculousfish
af2d348543 Substantial modifications of expand_variables to modernize, normalize memory management, adopt C++ types 2012-01-30 21:33:15 -08:00
Jan Kanis
23bc10dfe6 Add stddef.h to util.c, so ptrdiff_t is defined in all environments 2012-01-31 01:38:20 +01:00
ridiculousfish
13f72decf4 Fix a leak 2012-01-30 11:23:09 -08:00
ridiculousfish
3ad7de0fcb Fix some leaks and clean up expand_pid to use wcstring 2012-01-30 11:15:06 -08:00
Siteshwar Vashisht
48408b0a0b Merge branch 'CPlusPlus' of gitorious.org:~ridiculousfish/fish-shell/fishfish into CPlusPlus 2012-01-31 00:04:15 +05:30
Siteshwar Vashisht
cd7d1f2bfe Fix to not show thread debugging warning when entering characters like "~%". expand_string2() now uses it's own parser instead of principal_parser. Added PARSER_TYPE_ERRORS_ONLY in parser_type_t. 2012-01-30 23:58:30 +05:30
ridiculousfish
ed66a46113 Fix for is_potential_path that caused all strings to be reported as paths 2012-01-30 09:59:48 -08:00
ridiculousfish
8e4e30d266 Migrate functions like parser_keywords_is_block to wcstring 2012-01-30 09:46:33 -08:00
Siteshwar Vashisht
f988dcd6f9 Fixed compilation errors caused by latest commits 2012-01-30 21:45:02 +05:30
ridiculousfish
143091edad More work to excise halloc 2012-01-30 02:45:55 -08:00
ridiculousfish
79e0405f6a Yet more un-hallocing 2012-01-30 02:23:58 -08:00
ridiculousfish
316f81119f Excised some more halloc 2012-01-29 23:22:42 -08:00
ridiculousfish
8d016040ab Back out removing a halloc_register to fix a leak 2012-01-29 22:32:01 -08:00
ridiculousfish
4da6986a68 Fix to finally make builtin_scripts.h and builtin_scripts.cpp be generated by the Makefile 2012-01-29 22:29:13 -08:00
ridiculousfish
3b8a4e56b0 A bunch of work to move towards a sane memory model in job_t 2012-01-29 22:06:58 -08:00
ridiculousfish
966cd6a8ca Began migration of job_t away from halloc 2012-01-29 18:25:54 -08:00
ridiculousfish
f243cd86c9 Convert jobs list to std::list 2012-01-29 16:36:21 -08:00
Siteshwar Vashisht
1a5d866a91 buggy-auto-complete is not so buggy now. Merged branch 'buggy-auto-complete' into CPlusPlus 2012-01-29 14:11:39 +05:30
Siteshwar Vashisht
a1d8ed83dd Putting a copyright statement on my script :) 2012-01-29 13:02:40 +05:30
Peter Ammon
7f284c404f Fixed for comment in create_manpage_completions.py to refer to new filename 2012-01-28 22:48:47 -08:00
ridiculousfish
d1b3b6a0ed Added create_manpage_completions.py file for generating completions from man pages 2012-01-28 22:25:45 -08:00
ridiculousfish
9b37bc667f Fix for issue where we treated all cached files as accessible for the purpose of highlighting, instead of using their cached accessible variable 2012-01-28 15:49:50 -08:00
ridiculousfish
4eea68b5a4 LRU work to load functions off of the main thread.
We'll have to reevaluate this after we fix function autocomplete
2012-01-28 14:56:13 -08:00
ridiculousfish
87429bc03c More work on LRU cache and adopting it in function and completion autoloading 2012-01-27 11:43:52 -08:00
ridiculousfish
6c28448e84 Added LRU tests, and made tests work again 2012-01-27 11:43:45 -08:00
ridiculousfish
843ba4ac2c Move autoload class into autoload.h and cpp 2012-01-25 18:59:35 -08:00
ridiculousfish
d6545588a3 Have to remember to evict nodes from our LRU cache 2012-01-25 18:51:26 -08:00
ridiculousfish
26b375a0de Removed access_tracker since we don't need it after all 2012-01-25 18:42:41 -08:00
ridiculousfish
2f1cac604d Implemented LRU cache for autoloading. 2012-01-25 18:40:08 -08:00
ridiculousfish
8e56763c98 LRU cache work 2012-01-25 11:47:45 -08:00
ridiculousfish
e94e1cc72f New file autoload.h that will ultimately handle autoloading completions and functions 2012-01-25 00:36:55 -08:00
Jan Kanis
8ae00697c9 Merge branch 'merge-requests/14' 2012-01-25 01:21:14 +01:00
Jan Kanis
b0c6d891e9 reviewed merge reqest 14:
* fixed some whitespace inconsistencies
* changed variable handling in __fish_complete_subcommand_root
2012-01-25 01:14:47 +01:00
Jan Kanis
548164cd5e do not escape 'commandline' output without the -o flag 2012-01-25 00:11:00 +01:00
ridiculousfish
4dfe36feb1 Migrate input_function_get_names to wcstring_list_t 2012-01-23 20:48:47 -08:00
ridiculousfish
0d1c2a3b2a Migrated function.cpp to use the new function_get() call. Lots of nice short code now. 2012-01-23 20:43:39 -08:00
ridiculousfish
378fd60756 Migrate function.cpp to scoped_lock and shared_ptr 2012-01-23 20:32:36 -08:00
ridiculousfish
fa569b32fb Made intern'd strings thread safe.
Removed intern_free_all().
2012-01-23 20:02:15 -08:00
ridiculousfish
78f8317de8 Typo fixes 2012-01-23 19:33:57 -08:00
ridiculousfish
6e8637fbc9 Move autoloading from a map of path names to a real object autoload_t.
Moved the various things we can autoload into static objects.
Next step is to make them thread safe.
2012-01-23 11:42:41 -08:00
ridiculousfish
8403aae928 Convert some cases where parsers are created to using PARSER_TYPE_GENERAL 2012-01-22 21:57:30 -08:00
ridiculousfish
b43c8da66b More work towards instanced parser. First successful compilation 2012-01-22 21:40:08 -08:00
ridiculousfish
da85bdc401 More work on the instanced parser 2012-01-22 20:47:13 -08:00
ridiculousfish
7e486e3b5c More work towards instanced parser 2012-01-20 11:24:43 -08:00
Siteshwar Vashisht
062e423125 Fixed more known auto completion bugs; auto completion calls working fine now 2012-01-20 22:20:31 +05:30
ridiculousfish
3d8face1f9 More work on instancing the parser 2012-01-19 10:28:44 -08:00
Siteshwar Vashisht
0c99fc5b4d Removed unnecessary const_cast in wildcard.cpp 2012-01-19 22:23:25 +05:30
Siteshwar Vashisht
51d7d5d0da Fixed calls to expand_variables2() in expand.cpp 2012-01-19 21:49:24 +05:30
Siteshwar Vashisht
c959584831 Fixed reader.cpp to not show garbage while showing help on auto completing (on pressin tab) for executables like "ls -" 2012-01-19 00:03:19 +05:30
ridiculousfish
fa796d668f Get some basic function signatures right for new instanced parser 2012-01-16 12:10:08 -08:00
ridiculousfish
e4ee4ec3d1 Some const correctness 2012-01-16 11:16:12 -08:00
ridiculousfish
0073a93079 Beginnings of instance parser work 2012-01-16 11:09:19 -08:00
Siteshwar Vashisht
7e124cf95e Added constructor to completion_t for guarranted initialzation of flags attribute. 2012-01-16 23:54:57 +05:30
ridiculousfish
c647bed9d5 Fix for bogus check for IFS environment variable 2012-01-16 09:43:34 -08:00
Siteshwar Vashisht
6f330f961b Merge branch 'CPlusPlus' of gitorious.org:~ridiculousfish/fish-shell/fishfish into CPlusPlus 2012-01-16 22:27:55 +05:30
Siteshwar Vashisht
140ead65b6 Converted all auto completion calls (on pressing tab) to use std::vector<completion_t>, bugs are yet to be fixed 2012-01-16 22:26:47 +05:30
ridiculousfish
f12fd3707e Added a missing header for ptrdiff_t 2012-01-15 15:23:05 -08:00
ridiculousfish
55091d9deb Fix to prevent autoloading of completions on highlight thread 2012-01-15 14:24:58 -08:00
Peter Ammon
1b3427acd9 Changes to make completions internalized scripts.
This about doubles the size of fish. These things are huge. We may not want to ship it like this.
2012-01-15 00:25:21 -08:00
Peter Ammon
60d1ac4fec More const and signed correctness. Warnings now fit on one page! 2012-01-14 22:48:53 -08:00
Peter Ammon
9b133a978d Improve const and signed/unsigned correctness 2012-01-14 22:32:45 -08:00
Peter Ammon
203c749e6c Improved const-correctness, eliminating warnings.
Migrated some int to size_t
2012-01-14 22:00:00 -08:00
Peter Ammon
f3e2d2f68f Lots of warnings fixes and const correctness 2012-01-14 03:41:50 -08:00
Peter Ammon
a359f45df2 Redesign new environment variables to use env_var_t instead of wcstring
Migrate uses of empty() to missing() to distinguish between empty variable and unset variable
2012-01-14 02:42:17 -08:00
Peter Ammon
e8b6d48ad0 Introduce env_var_t to replace empty string as missing environment variable 2012-01-14 01:06:47 -08:00
ridiculousfish
8ba79d6ab9 Migrate function.cpp to STL types. 2012-01-13 23:54:49 -08:00
ridiculousfish
57c9eeeecb Changes related to supporting "intern scripts." These are scripts that used to be installed in /share/functions, but now are just compiled-in strings. This should reduce the amount of I/O done at launch time. 2012-01-13 23:54:16 -08:00
Siteshwar Vashisht
f78c4fa751 Removed multiple delcartions of path_list from autoload_names() in fuction.cpp 2012-01-14 12:06:16 +05:30
Siteshwar Vashisht
3ba6e9db5d Merge branch 'Use_env_get_string' into CPlusPlus
Conflicts:
	function.cpp
2012-01-14 11:59:48 +05:30
Siteshwar Vashisht
610246c48f Modified function.cpp to use env_get_string(). 2012-01-12 23:22:38 +05:30
Siteshwar Vashisht
d0e18e3d20 Modified highlight.cpp to use env_get_string(). 2012-01-12 23:19:05 +05:30
Siteshwar Vashisht
72cfdbbb4e Modified input.cpp, output.cpp to use env_get_string() 2012-01-12 23:11:07 +05:30
Siteshwar Vashisht
15296dedd5 Modified kill.cpp to use env_get_string(). 2012-01-12 23:07:10 +05:30
Siteshwar Vashisht
943cc68f54 Modified parse_util.cpp, parser.cpp, path.cpp to use env_get_string() 2012-01-12 22:56:53 +05:30
Siteshwar Vashisht
3bb4d0b276 Modified reader.cpp to use env_get_string() 2012-01-12 22:32:50 +05:30
Siteshwar Vashisht
9cc2217a26 Fixed connection error to fishd server in env.cpp 2012-01-12 21:58:42 +05:30
Siteshwar Vashisht
ee687ee433 Modified exec.cpp to use env_get_string(); rolled back changes to expand.cpp in last commit, because pressing ^D results into an error with the changes 2012-01-12 21:39:00 +05:30
Siteshwar Vashisht
9b56b67c0e Revert "Modified expand.cpp and exec.cpp to use env_get_string()"
This reverts commit 48655e882e.
2012-01-12 04:21:11 +05:30
Siteshwar Vashisht
48655e882e Modified expand.cpp and exec.cpp to use env_get_string() 2012-01-12 04:19:04 +05:30
Siteshwar Vashisht
7f49d37a51 Modified exec.cpp to use env_get_string() 2012-01-12 04:01:08 +05:30
Siteshwar Vashisht
9f8a1168e6 Modified env.cpp to use env_get_string() 2012-01-12 03:57:38 +05:30
ridiculousfish
c18d177b8c Additional migration to STL data structures 2012-01-10 12:55:22 -08:00
Siteshwar Vashisht
7bde2b5cbf Modified complete.cpp to use env_get_string(); Fixed env_get_string() return an empty wcstring instead of returning 0. 2012-01-10 01:40:03 +05:30
Siteshwar Vashisht
7b3377e78c Modified builtin_set.cpp to use env_get(), added functions like update_values2(), env_set2() etc. to support wcstring and vector instead of using array_list_t 2012-01-10 01:19:37 +05:30
Siteshwar Vashisht
feed900f3d Further changes in builtin.cpp to use env_get_string() 2012-01-10 00:05:51 +05:30
Siteshwar Vashisht
7530057c6e Modified builting.cpp to use env_get_string() 2012-01-10 00:00:54 +05:30
Siteshwar Vashisht
a6b3f6b5d4 Modified screen.cpp to compile on Linux. 2012-01-07 16:35:49 +05:30
ridiculousfish
76f870a30a Improved check for pthread library to build successfully on Linux 2012-01-06 11:50:17 -08:00
ridiculousfish
02092f315e More work towards incorporating C++ build steps into Makefile.in and configure.ac 2012-01-06 11:29:03 -08:00
ridiculousfish
9ef9284a34 Fix for bogus cast warning in configure script that was breaking local_cv_use__posix_c_source 2012-01-06 10:43:27 -08:00
ridiculousfish
820acb981b Fix to incorporate C++ build changes into configure.ac and Makefile.in 2012-01-06 10:23:38 -08:00
ridiculousfish
2516fd90eb Updated dependencies in Makefile.in 2012-01-05 14:10:02 -08:00
ridiculousfish
de23368d03 Updated Makefile.cpp with updated header dependencies 2012-01-05 14:06:09 -08:00
ridiculousfish
4df57fda09 Incorporate Siteshwar's patch for building on Linux 2012-01-05 13:58:48 -08:00
ridiculousfish
6f45832aed Switch from std::set to std::map in parse_util.cpp 2012-01-04 17:56:02 -08:00
ridiculousfish
fec0415d4e Rewrote parse_util.cpp data structures to use STL types and classes 2012-01-04 17:40:36 -08:00
ridiculousfish
04c7d87261 More work towards supporting builtin scripts 2012-01-03 10:54:06 -08:00
ridiculousfish
6abf3db13e Added internalize_scripts.py in preparation for ending reliance on "standard" scripts in /usr/local/share 2012-01-02 17:02:30 -08:00
ridiculousfish
99000e68b7 Fix for crash when unescaping a string with unbalanced quotes
Add Mac OS X's default term name to terms for which we know how to set a title
2012-01-02 13:40:03 -08:00
ridiculousfish
bef046a51a More work to migrate off of ad-hoc data structures 2011-12-31 15:57:30 -08:00
ridiculousfish
78322a6321 Migrate some more away from array_list_t 2011-12-28 12:36:47 -08:00
ridiculousfish
46fa2dd2f0 Migration of screen away from ad-hoc lists 2011-12-27 18:41:38 -08:00
ridiculousfish
451399b344 Migrate to std::vector in event class 2011-12-27 00:06:07 -08:00
ridiculousfish
22a8e57a57 More migration away from al_list 2011-12-26 23:29:57 -08:00
ridiculousfish
9cd279e0e9 Migrate some more off of al_list 2011-12-26 23:13:05 -08:00
ridiculousfish
b67eaa3abd More migration to the STL 2011-12-26 22:51:34 -08:00
ridiculousfish
046c9b56f5 Migrate blocked to std::vector 2011-12-26 22:27:58 -08:00
ridiculousfish
6ad80247ce Migrate killme to std::vector 2011-12-26 22:22:55 -08:00
ridiculousfish
0b744edfa4 Migrate events to std::vector 2011-12-26 22:18:16 -08:00
ridiculousfish
0d8bb78f66 Fixed a build failure
Added a thread assertion to function.cpp
2011-12-26 21:56:23 -08:00
ridiculousfish
28ecc68841 Migrated some more data structures to the STL. Removed some ad-hoc data structure implementations. 2011-12-26 21:50:23 -08:00
ridiculousfish
7c7aba1202 Fix to migrate the universal variable server off of dyn_queue_t 2011-12-26 21:39:08 -08:00
ridiculousfish
74a1d70b8a Added iothread 2011-12-26 21:21:12 -08:00
ridiculousfish
165a5aaa83 Merge branch 'master' into CPlusPlus 2011-12-26 21:09:26 -08:00
ridiculousfish
8b407a32ff Fix to use proper type to compute difference between two pointers, which fixes a crash when fish is compiled LP64 2011-12-26 21:08:45 -08:00
ridiculousfish
04856aded0 IO port 2011-12-26 21:05:25 -08:00
ridiculousfish
a9c238a1fc Removed a log 2011-12-26 21:05:07 -08:00
ridiculousfish
8d2f107d61 Some changes to migrate towards C++ and a multithreaded model 2011-12-26 19:18:46 -08:00
ridiculousfish
3f16ace678 Initial C++ conversion 2011-12-26 19:11:54 -08:00
Jan Kanis
344b9bdba3 Merge branch 'master' into merge-requests/14 2011-12-17 14:19:29 +01:00
Jan Kanis
834ea94eb9 update aptitude completions, patch by Dániel Ugra, closes Launchpad bug 238282 2011-09-25 01:24:34 +02:00
Jan Kanis
a060cc5893 uniq doesn't filter duplicates that aren't consecutive, use sort -u 2011-09-23 21:59:50 +02:00
gonchar
7ef0b3b821 *wvdial completion fixed 2011-09-23 18:40:14 +04:00
gonchar
39a2fd1717 * git rm and git status options are added
* ssh subcomand completion
* __fish_complete_subcommand now can skip variable number of tokens
2011-09-23 14:51:14 +04:00
gonchar
c66ec4df3d * __fish_complete_subcommand_root now passes arguments to
__fish_complete_subcommand

* sudo:
  - now can be completed bu group and user (-u and -g keys).
  - subcommand completion is fixed

* __fish_complete_proc.fish is added to complete killall command with
  list of running processes

* __fish_complete_tex.fish is updated with common options

* __fish_make_completion_signals.fish is added to make a list of kill
  signals for kill and killall

* completions:
 - minor filetype completions are added for djview, xpdf, mupdf, gv,
   xdvi
 - adduser is copmleted by user and group
 - dlocate and dpkg are completed by packages
 - find: -executable options is added
 - htop: options
 - funced and funcsave are completed by function names
 - ifdown and ifup are copmleted by interfaces
 - kill and killall: options, signals and processes
 - latexmk, ln, nm: options
 - lualatex and xelatex copmletions
 - sudo: -u and -g options
 - wvdial: presets
2011-09-23 12:24:21 +04:00
Jan Kanis
c25c48f763 Merge commit 'refs/merge-requests/13' of git://gitorious.org/fish-shell/fish-shell into merge-requests/13 2011-09-21 16:31:40 +02:00
Jan Kanis
5105d8d87e fixed bug where case-insensitive completion of /path\ with\ spaces/ doesn't reposition the cursor correctly 2011-09-21 15:40:45 +02:00
Mark A. Miller
35af336ff6 Fix an old, old reference to a long-gone fish function for gem.fish 2011-08-13 23:50:54 -05:00
Grissiom
157ca12d4b Merge commit 'refs/merge-requests/12' of git://gitorious.org/fish-shell/fish-shell into merge-requests/12 2011-07-28 10:06:19 +08:00
Adam Cozzette
e9d1a54983 fix: Fish may hang in Linux virtual console
I find that if I have a config.fish consisting of the following two
lines

status --job-control full
. empty.fish

where empty.fish is just an empty file in ~/.config/fish,  Fish will
hang when I attempt to log in on a virtual console (e.g. tty1). If I run
Fish within X11 or with either of those lines commented out,
everything's fine. I think the second line can be any command that cause
Fish to perform a fork().

The fix is pretty simple and just involves replacing getpid() with
getpgrp() in terminal_return_from_job in proc.c. See below for the
detailed explanation. I'm certainly no expert so I would appreciate it
if anyone else can confirm that my fix looks ok.

Here's what causes the bug as far as I can tell:

1. When I login on a virtual console,  /bin/login calls Fish. When Fish
begins executing its process group and the process group controlling the
terminal are both the pid of the /bin/login process.

2. The ". empty.fish" line causes Fish to fork a new process. The new
process creates a new process group and takes control of the terminal
under the name of that process group.

3. When the child process finishes,  the parent prcoess attempts to take
back control of the terminal by setting its controlling process group id
to be its pid.

4. Now there is a mismatch between the process group id of the Fish
shell (= the pid of the /bin/login process) and the process group id
controlling the terminal (= the pid of the Fish shell).
reader_interactive_init detects the mismatch and it thinks that it
doesn't have control of the terminal,  so it hangs as it waits for
control.

My fix just solves the problem in step 3 by having the parent process
correctly reassign control of the terminal to its process group.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2011-07-28 09:50:39 +08:00
Chris Nilsson
c8981c048f Merge commit 'refs/merge-requests/10' of git://gitorious.org/fish-shell/fish-shell into merge-requests/10 2011-07-10 16:32:44 +10:00
Andreas Raster
1ae44c6b3c still didn't work correctly, there were delimiters missing in the conditional as well 2011-06-24 02:45:05 +02:00
Andreas Raster
b2887477e3 last commits fix now also applied in the 'else' clause 2011-06-21 23:17:03 +02:00
Andreas Raster
8e2db29c9a fixed an issue when trying to complete something like 'cd /mnt/windows7/Program\ Files\ \('
fish would always spew a huge error message all over my terminal complaining about
some kind of tokenizer error, this patch fixed that
2011-06-21 17:02:49 +02:00
Shaun Reich
d38de7365a Change git-symbolic-ref to git symbolic-ref.
On my system at least (fedora 15), git-symbolic-ref is an invalid
command. Not sure if it's a BIC change from git itself, a distribution
thing, or a mistake on my end. Either way, no harm in using the
extended version. Now I get git branch status (yay).
2011-06-19 14:14:40 -04:00
Jakukyo Friel
cde6067cae minor changes on user doc 2011-02-20 02:58:11 +08:00
Christopher Nilsson
2583638f4b Merge commit 'refs/merge-requests/8' of git://gitorious.org/fish-shell/fish-shell into merge_request_8 2011-01-11 23:22:27 +11:00
Dylan Smith
11360b018f mimedb: Search all the defaults.list files rather than just the first.
The first defaults.list file found should not override all the other ones,
it just needs to be searched first.

E.g. For me (cat ~/.local/share/applications/defaults.list) returns
[Default Applications]
text/html=chromium-browser.desktop

So this should be used for text/html mimetypes, but the other defaults.list
files should be searched for other mimetypes.

I had to refactor get_filename so that it can return all the filenames, so
I changed it to append_filenames that appends all the filenames to a list
and provided a wrapper function called get_filename.
2010-12-02 23:55:45 +08:00
Grissiom
bdfc62184d fish_indent: indent "case" with the same level as "swith" 2010-12-02 23:42:48 +08:00
Grissiom
74f06d550a fish_indent: don't indent commands after a pipe
commands after a pipe tend to be at the same line of previous command.
So don't indent them.
2010-12-02 23:42:24 +08:00
James Bowlin
46986ad4c2 Use eix instead of emerge when possible
On Gentoo the eix program is MUCH faster than emerge for listing package
names.  I've left the emerge code in as a 2nd choice because not every
Gentoo system has eix installed (although they should).  Also,  the
emerge code didn't seem to produce any output on my system.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-12-02 01:33:56 +08:00
Dylan Smith
6a5d6471c5 mimedb: Search for exact mime type match in search_ini. 2010-12-02 01:19:56 +08:00
Dylan Smith
cf0850edfd mimedb: Add seperator between directory and filename in file_exists.
get_filename tried to work around this with hardcoded strings that end with
a '/', but would fail to work properly for environment variables
XDG_DATA_HOME or XDG_DATA_DIRS that don't do the same.
2010-12-02 01:16:29 +08:00
Dylan Smith
fd4ac87382 funcsave: Fixed error and help handling.
Renamed references to the previous command name of save_function to
funcsave, and returned an error after printing the help text when no
arguments are specified.
2010-12-02 01:13:51 +08:00
Dylan Smith
164144f126 default_key_bindings: Added mappings for ctrl-arrow keys.
On debian and ubuntu these control sequences are output while using
gnome-terminal and xterm.
2010-12-02 01:13:04 +08:00
Dylan Smith
f2ad4a2e8e Makefile: test for xsel directory before trying to clean it.
This avoids the users seeing ignored errors for make -C  clean.
2010-12-02 01:12:34 +08:00
Grissiom
df23913bb8 fish_indent: only output fd number when have to
The original patch is own by Dylan. I just did some cleaning and
reformating.
2010-12-01 13:05:10 +08:00
Dylan Smith
4ccf26fbcc builtin: count should not accept options, not even help
It is documented this way, but the common builtin_run function was
checking for -h or --help before even calling the builtin_count. Without
this functions like funced can't use count to check the number of
arguments before checking for -h or --help.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-26 19:00:18 +08:00
Dylan Smith
081e277fe4 builtin: read's --shell long option should require an argument
The short option -s doesn't need it and it won't be used.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-25 19:09:31 +08:00
Christopher Nilsson
dcecab384a Merge commit 'refs/merge-requests/6' of git://gitorious.org/fish-shell/fish-shell into merge_req_6 2010-11-24 22:34:29 +11:00
James Vega
4f9b07e979 Allow fish_greeting to be NULL or an array
Treat fish_greeting as a whole when show up the greeting messages. And
the user may want to set fish_greeting to an null value or an array.
This requires that the variable be quoted when used as an argument for
switch in __fish_config_interactive.

Signed-off-by: James Vega <jamessan@debian.org>
[modified the commit message]
Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-24 00:49:15 +08:00
Grissiom
9b97c55546 add test case for 364d3dbbf8 2010-11-24 00:35:56 +08:00
Dylan Smith
364d3dbbf8 exec: Don't format status returned directly from builtin function
The builtin function returns the raw status, which is not the same as
the integer return by waitpid. Therefore, the WIF macros shouldn't be
used for checking or obtaining the status.

This bug can be seen by executing (eval false). The builtin eval
function returns 1, but proc_format_status misinterprets it as a signal
by checking WIFSIGNALED, so adds 128 to the status to return 129.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-24 00:27:16 +08:00
James Vega
9f3a4d1640 Fix some spelling mistakes
Fix spelling mistakes in various bits of the documentation.

Signed-off-by: James Vega <jamessan@debian.org>
Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-23 23:50:49 +08:00
Dylan Smith
5fca92994f help.fish: Fix the sed expression to find anchors with id or name
Previously the expression only searched for anchors with a name
attribute, but doxygen 1.7.1 is producing anchors with the id attribute
instead. The sed expression allows both cases for compatibility.

I also used single quotes for the sed expression to avoid escaping
double quotes.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-23 23:37:09 +08:00
Grissiom
fefd17fe5e add test case for 6b243fbc 2010-11-23 23:05:21 +08:00
Dylan Smith
6b243fbcd3 eval: (eval false) should return an error status
This also caused (isatty < /dev/null) to return 0 since it uses eval,
and (ls | cat) to output using the classify indicator style since it
uses isatty. This is how I found the bug.

Reviewed-by: Grissiom <chaos.proton@gmail.com>
2010-11-22 19:36:42 +08:00
Dylan Smith
82f8c3834e Makefile: Provide PACKAGE_TARNAME for autoconf default docdir
docdir was previously being set to "${prefix}/share/doc/${PACKAGE_NAME}"
when it wasn't explicitely set on configuration using --docdir. Without
this appearing in the Makefile, some files silently get silently
installed directly into ${prefix}/share/doc instead within a fish
subdirectory.

I also added datarootdir to fix an autoconf warning,  since autoconf
normally would use it for the directory paths (e.g. docdir =
${datarootdir}/doc/${PACKAGE_TARNAME}). The autoconf generated configure
script has a hack to fix this, but states: "FIXME: This hack should be
removed a few years after 2.60."
2010-11-22 19:05:06 +08:00
Grissiom
e0ba91db31 Revert "use is_interactive instead of isatty to test whether we are in interactive mode"
This reverts commit ceba377ab8.
2010-11-22 08:43:21 +08:00
Grissiom
fa148bf59f break long lines 2010-11-22 08:42:57 +08:00
Christopher Nilsson
1b0ce33669 Merged changes from codemonkey and grissiom branches
Conflicts:
	kill.c
	seq.in
2010-11-12 02:07:14 +11:00
David Frascone
0cf2a1eb33 Fixed negative indices in the seq command 2010-11-05 09:34:42 -06:00
David Frascone
8a46a8ecb2 This change allows for customizing of the clipboard buffer, by supplying
a command to accept the "copy".  So, you add your clipboard buffer command
to an environment variable, and custom commands will be used for the copy
program.  Very useful when your OS is not naitively supported by fish.
2010-11-05 09:32:05 -06:00
David Frascone
4f0221bc4f Modify getopt string to force posix compliance. I forgot why I
needed this -- but -- some options were not working right.
2010-11-05 09:29:10 -06:00
David Frascone
ce08bb2ad2 The grep on the commands would sometimes output errors, causing noise and
breaking scripts.
2010-11-05 09:26:26 -06:00
David Frascone
93f797326e Optimized the result of the xsel check, so that it is cached.
It is called very often, and causes a significant performace hit.  The
availability of xsel is not likely to change during the invocation of
the shell.
2010-11-05 09:22:28 -06:00
Grissiom
ceba377ab8 use is_interactive instead of isatty to test whether we are in interactive mode 2010-10-13 04:30:23 +08:00
Grissiom
b9b6e867df check allocated memory when setting SHLVL 2010-10-08 09:38:06 +08:00
Grissiom
f47caefdb9 fix a memory allocation bug in commit 1e27024d75 2010-10-08 09:01:25 +08:00
James Buren
41ae7bccc2 silences some warnings outputted by gcc with -Wall and -Wextra 2010-10-08 08:43:57 +08:00
Grissiom
1e27024d75 accumulate SHLVL env variable at startup 2010-10-08 08:35:22 +08:00
Grissiom
6654fff377 fix null reference when erase TERM env
Way to reproduce:

> set -e TERM
fish: function contains_internal called with null value for argument a.
fish: This is a bug. If you can reproduce it,  please send a bug report
to fish-users@lists.sf.net.
fish: Backtrace:
/home/grissiom/sysroot/bin/fish(show_stackframe+0x1a) [0x43519a]
/home/grissiom/sysroot/bin/fish(contains_internal+0xce) [0x4373ee]
/home/grissiom/sysroot/bin/fish(reader_write_title+0x59) [0x424179]
/home/grissiom/sysroot/bin/fish() [0x4242d5]
/home/grissiom/sysroot/bin/fish(reader_readline+0x54) [0x425974]
/home/grissiom/sysroot/bin/fish(reader_read+0xba) [0x42742a]
/home/grissiom/sysroot/bin/fish(main+0x4be) [0x43b19e]
/lib64/libc.so.6(__libc_start_main+0xfd) [0x7fcbe0dcbb6d]
/home/grissiom/sysroot/bin/fish() [0x408c29]
2010-10-06 20:58:13 +08:00
Grissiom
89d999df72 some optimization on filling prompt_buff 2010-10-06 20:37:30 +08:00
Grissiom
a941d82be3 don't expand variables in no_exec mode
We couldn't know variables values unless execute commands, so disable
variable expansion in no_exec mode.
2010-10-06 11:37:59 +08:00
Grissiom
694cdf5ae1 update .gitignore 2010-10-05 21:14:43 +08:00
Grissiom
2bfe4afea2 add prof target 2010-10-05 02:23:18 +08:00
Grissiom
d559c3fe2e fix bug in build debug targe 2010-10-05 02:22:33 +08:00
Grissiom
27df727ca1 don't parse the options that should be passed to fish scripts
This commit makes fish_parse_opt stop at first non-option argument,
which expected as fish script name and pass the remaining argument to
that script. I also updated the test cases.
2010-10-03 11:46:26 +08:00
Grissiom
8910226d2f only count the last line of promt when caculate prompt width 2010-09-24 19:01:13 +08:00
Grissiom
04f58b1a31 ignore tmp staff in tests/ 2010-09-24 11:34:35 +08:00
Grissiom
1b9dd0c75f Merge remote branch 'origin/otherchirps-dev' 2010-09-19 14:12:30 +08:00
Grissiom
a7af415b6a call original grep in sgrep
functions/grep.fish will set the GREP_OPTIONS, which will ruin sgrep's
effort.
2010-09-19 13:56:30 +08:00
Grissiom
f8a5a59513 Revert "match the whole command for git completion"
This reverts commit d957d23d8f.
Use __fish_git_using_command to test commands and __fish_contains_opt to
test arguments.
2010-09-19 11:04:24 +08:00
Grissiom
ac3dfb3f96 don't complete file names for git checkout 2010-09-19 00:19:44 +08:00
Grissiom
d957d23d8f match the whole command for git completion 2010-09-19 00:17:53 +08:00
Grissiom
d049947801 event_fire( 0 ); => event_fire( NULL ); 2010-09-18 21:30:02 +08:00
Grissiom
21a10c3c74 use $() in Makefile var expansion 2010-09-18 21:29:05 +08:00
Grissiom
04951f8b34 reader_read( 0... => reader_read( STDIN_FILENO 2010-09-18 20:26:54 +08:00
Grissiom
c08bae6aeb configure xsel in configure phase
... and with the same arguments of fish
2010-09-18 14:31:18 +08:00
Grissiom
3aa107c4ae add XSEL_BIN var in configure.ac 2010-09-18 13:49:03 +08:00
Grissiom
e196091714 make clean should clean xsel and make distclean should delete it 2010-09-18 13:41:27 +08:00
Grissiom
d35d65cc40 use variables as xsel target 2010-09-18 13:27:34 +08:00
Grissiom
7f7b30959b don't make xsel in subshell 2010-09-18 13:14:59 +08:00
Grissiom
70322077d2 remove trialing spaces #2 2010-09-18 10:18:26 +08:00
Grissiom
f529b2e057 upgrade xsel to 1.2.0
xsel 1.0 begin to support UFT-8.
2010-09-18 10:14:14 +08:00
Grissiom
c6372a1b3f remove trailing spaces
This is done by `sed -i -e 's/[ \t]*$//' *.[c,h]`, which should not
introduce any functionality change.
2010-09-18 09:51:16 +08:00
Grissiom
41b8db063c add git submodule completion
Merged from http://github.com/weavejester/fish-git
2010-09-17 16:38:26 +08:00
Grissiom
1b16758d7e Fix cd prompt fail on the case that CDPATH have variables 2010-09-17 16:01:44 +08:00
Grissiom
51b5adc306 ignore ~ backup files 2010-09-16 13:32:18 +08:00
Grissiom
56f8993b8c ignore po/*.gmo 2010-09-16 13:31:49 +08:00
Ben Hoskings
8c4d1ca587 Added .gitignore. 2010-09-16 13:30:59 +08:00
Christopher Nilsson
ec8b3593f3 added '-c' option to the functions.txt docs. 2010-09-12 20:29:34 +10:00
Christopher Nilsson
5c9b42e260 'functions --copy': added sanity check on new function name.
Now matches function create behaviour, running the new function name through
wcsfuncname() and parser_keywords_is_reserved(), before allowing the copy.
2010-09-12 13:16:11 +10:00
Christopher Nilsson
7914c92824 replaced the functions '--rename' option with '--copy'.
Copying the function implementation was the main point. Actually removing the original isn't necessary, as that
functionality already exists (functions -e).
2010-09-09 23:48:18 +10:00
Christopher Nilsson
208be0f4d4 Adding '--rename' option to 'functions' builtin.
Aim is to allow an existing function to be renamed, allowing some basic function chaining.

Example:

> function foo
     echo Hello
  end
> foo
Hello
> functions --rename foo bar
> foo
fish: Unknown command 'foo'
> bar
Hello
> functions --rename fish_prompt old_prompt
> function fish_prompt
      printf "{Boo!}%s" (old_prompt)
  end
{Boo!}>

Note in the last case, the new fish_prompt is calling its old definition.
2010-09-08 03:31:05 +10:00
Ben Hoskings
7cfac5bb59 Fix an fprintf() type warning in set_color.c by using "%s". 2010-04-09 16:05:19 -07:00
Ben Hoskings
1bd09bfd40 Fix casting warnings in screen.c / s_update() by casting al_get() twice to convert type and then size, instead of both at once. 2010-04-09 16:05:18 -07:00
Ben Hoskings
517751f2a3 Declare write_loop() in print_help.c to fix warning (it's declared in common.h, but including that file here breaks things badly). 2010-04-09 16:05:18 -07:00
Ben Hoskings
006952c571 Fixed incompatible pointer warning in env_universal_common.c / iconv() call. 2010-04-09 16:05:18 -07:00
Ben Hoskings
7a8b7201a1 Write formatted duration to ENV_DURATION after commands that run for > 1s wall time. 2010-04-09 15:56:32 -07:00
Ben Hoskings
1157e4d7b2 Allow newlines in fish_prompt, by joining prompt_list with newlines instead of nothing in exec_prompt(). 2010-04-09 15:56:15 -07:00
Ben Hoskings
6b8e7b16f6 Reduced timeout in select_try() from 5s to 10ms. 2010-04-09 15:56:09 -07:00
axel
1eb089d722 Bump version number
darcs-hash:20090308144106-ac50b-e64db4a3009f99b3c1d206bba1781775faef671c.gz
2009-03-09 00:41:06 +10:00
axel
e50d0c18b0 Update todo list
darcs-hash:20090308142007-ac50b-22e9cc31212ff9647f75426327cdf5aff2d30f79.gz
2009-03-09 00:20:07 +10:00
axel
810d5f9548 Fix interactive job in background busy wait bug, reported by Randall D. Wald
darcs-hash:20090301021441-ac50b-a9488a9e55f545c3b8bd52aa0fb00b2b967974a8.gz
2009-03-01 12:14:41 +10:00
James Vega
e0c317dfd4 Prevent potential infinite loop
Ignore-this: 24edfe9248e1b667fcf4d8e151dd50f2

darcs-hash:20090224183601-35ec8-5e86d44c77af33376bd80485689d60c761ff17c6.gz
2009-02-25 04:36:01 +10:00
axel
d5320fb9f9 Update copyright info, minor layout changes to section about licenses in fish
darcs-hash:20090222224540-ac50b-69c4f8dd027e4672b8d25f8240c1d5f625135ad1.gz
2009-02-23 08:45:40 +10:00
axel
14c84ffbcb Check return value of a few write calls and retry on EINTR, and fix a few other warnings, mostly by printing error messages before giving up.
darcs-hash:20090222202852-ac50b-b0e79142af5b7a99e55271d4001fa252d9684a1d.gz
2009-02-23 06:28:52 +10:00
axel
f71c6f3f0e Misc documentation updates
darcs-hash:20090222191714-ac50b-fdd090aafd60f71989ef5c63aac9f876dcad93eb.gz
2009-02-23 05:17:14 +10:00
axel
6dbb9e070d Hopefully make iconv detection work on OS X with non-gnu iconv implementation
darcs-hash:20090222191649-ac50b-4f7010fdbf662b71cb7c4c99d2ae6e00c7cccb83.gz
2009-02-23 05:16:49 +10:00
axel
47ae2a05ce Don't make complete builtin complain when used in non-interactive mode, as we can always launch a debug prompt. Who are we to question why?
darcs-hash:20090222162253-ac50b-bb3c9dc1d1fa33548a2ed7b3c7c4d21d527eba47.gz
2009-02-23 02:22:53 +10:00
axel
810262118a Fix read in noninteractive mode problems reported by James Reeves
darcs-hash:20090222162206-ac50b-c293945986f75103120606a64133b59fe82c02a6.gz
2009-02-23 02:22:06 +10:00
axel
f5be301a2f Handle exit status of processes terminated by signals
darcs-hash:20090221164656-ac50b-7bcbf6cb0bb8384560fbf9bf1059480cb4089def.gz
2009-02-22 02:46:56 +10:00
axel
b1357d11b2 Pressing Control-C (or otherwise changeing the command line content through the commandline builtin) should clear the search buffer.
darcs-hash:20090221154420-ac50b-52641fb6dd6e76aebc6244211e07c0861fb3eff0.gz
2009-02-22 01:44:20 +10:00
axel
5fc42fcaff prompt_pwd broken, this fix by James Reeves
darcs-hash:20090221104759-ac50b-35f7a896d3e62cd002605d47c090c7bec992317b.gz
2009-02-21 20:47:59 +10:00
axel
c1cf6a4071 Oops, I broke recursive wildcard completion
darcs-hash:20090221104330-ac50b-ab9d487d3fc77fab32d9c49045d23b3e9124e618.gz
2009-02-21 20:43:30 +10:00
axel
972f3e121e Document rename of save_function to func_save. Pointed out by Ovchinnikov George
darcs-hash:20090218202037-ac50b-0351e8564d3274cd4fb364c07b4a3260f8a45f20.gz
2009-02-19 06:20:37 +10:00
axel
0dd8ae4843 Added faw entry on history editing, written by Beni Cherniavsky
darcs-hash:20090216211940-ac50b-4175fb2ae8ec2f5a67ac3c6a33a48bc5ac35eea2.gz
2009-02-17 07:19:40 +10:00
axel
8a93b6f26d Make xdg-version of open handle multiple files.
darcs-hash:20090216211103-ac50b-f8268e8d50a84457bb49ac3d1e982cba09dbfec6.gz
2009-02-17 07:11:03 +10:00
axel
07717a3570 Add possibility to define greeting function, suggested by Chris Miller
darcs-hash:20090216210450-ac50b-9b4f7c5bf45afaf21d51e46ff8c2b11d171fcbf2.gz
2009-02-17 07:04:50 +10:00
Nick Pilon
79784d3e18 This patch fixes a problem where prompt_pwd was printing the full path twice under OS X and probably BSDs. (Which, needless to say, made for very long prompts) The problem was that (Free?)BSD sed and GNU sed handle ? differently. For BSD sed, ? is not special unless the -E flag is specified. The {0,1} syntax should work the same way in both.
darcs-hash:20080122180340-5b666-21f1cdb835cbfa458a0f3d7344370837db962388.gz
2008-01-23 04:03:40 +10:00
terceiro
c08c313c0a adds completion for Debian's invoke-rc.d command
Ignore-this: f9ff385e3c239cedfbc9850b06822bba

darcs-hash:20090204191757-69c1e-a55c2a720fd784c7be2534feacecd5e2ebdbeecd.gz
2009-02-05 05:17:57 +10:00
terceiro
dfd70057b3 function to put current git branch on the fish prompt
Ignore-this: 841402742571f399e012514315b8e4f0

darcs-hash:20090204190358-69c1e-2ebcf761a4e55bc049ff1d5bba272d722b2d4501.gz
2009-02-05 05:03:58 +10:00
terceiro
07dec5c3ed better git completion
Ignore-this: af7fede5c1ee1d92c89d2887cbe54c0b

darcs-hash:20090204185826-69c1e-f72e06ad575efee258b392afd17255166ac4a260.gz
2009-02-05 04:58:26 +10:00
axel
1ed5decf2c Fix warnings in FATAL_EXIT macro
darcs-hash:20090204224310-ac50b-111db6c8f5b74dad0a309441063d3d7e9bf8f55d.gz
2009-02-05 08:43:10 +10:00
Isaac Dupree
9b95dda6bf fix help for open
darcs-hash:20080605192305-6c1c4-ccf59a87bf7197b5d07a33d7aaeb31638aa0aa52.gz
2008-06-06 05:23:05 +10:00
axel
41015691db Make all fish that use universal variables binaries include iconv
darcs-hash:20090203002620-ac50b-6be533cd1bf7dd043d96547b2c2f3ab4cda30e10.gz
2009-02-03 10:26:20 +10:00
axel
7e1ac2d806 Actually escape the double-star recursive wildcard char when requested. This will make sure the syntax highlighting doesn't try to perform a recursive wildcard expansion when cheching command name existance, which killed performance
darcs-hash:20090202234751-ac50b-55dfd8b52f842826b02a69d6ab51c222108c30e3.gz
2009-02-03 09:47:51 +10:00
axel
35258bf1fb Make proper autoconf test for availability of posix nan function instead of fudging with the NAN macro.
darcs-hash:20090202232049-ac50b-0176955677ff39fdd05eeefa20dca883863c34e6.gz
2009-02-03 09:20:49 +10:00
axel
72025a6a38 Make fish avoid iterating through user list when completing file part of directory starting with tilde. Also add a timeout to the directory iteration, to protect against humongously large user databases.
darcs-hash:20090202224645-ac50b-353047a73e4d6f494f470fe2ea6c4a34b486d302.gz
2009-02-03 08:46:45 +10:00
axel
05341b055b ish's current hostname completion uses ~/.ssh/known_hosts as one of its sources of information, but ~/.ssh/config may also be useful. Gather all of the 'Host' declarations from ~/.ssh/config and filter out the ones with wildcards. Signed-off-by: James Vega <jamessan@debian.org>
darcs-hash:20090202210242-ac50b-cf50070ee33ab6113e32a4d997d464ac4b1faf24.gz
2009-02-03 07:02:42 +10:00
axel
9d7224d756 Add support for completing aliases in ssh. Written by David Bronke.
darcs-hash:20090201231805-ac50b-196d4c81981efe681677fe8ca7f1cc833a4734da.gz
2009-02-02 09:18:05 +10:00
axel
33ec8b45a0 Add effectv completions, written by Stefano Sabatini.
darcs-hash:20090201225558-ac50b-5704829043880d0264e3e3908d324a39857ada16.gz
2009-02-02 08:55:58 +10:00
axel
1dc49a4062 Fix color ls detection for BSD and OS X systems. Patch by Sven Axelsson.
darcs-hash:20090201222410-ac50b-e1e02244ae950c602d3b7e67fe567920c619024b.gz
2009-02-02 08:24:10 +10:00
axel
1123467991 Fix cd function to handle empty variables correctly. Patch by Sven Axelsson.
darcs-hash:20090201222058-ac50b-31a7ee2db9f68729c21ba153e1439cbeabff84ce.gz
2009-02-02 08:20:58 +10:00
axel
4f54da3795 Fix user completion so it can handle comments in the passwd file. Patch by Sven Axelsson.
darcs-hash:20090201221921-ac50b-ef0883afe4dc68b43c1c705d49b6b5505dbf1e73.gz
2009-02-02 08:19:21 +10:00
axel
c8de3d24c8 Add netcat completions, written by James Stanley
darcs-hash:20090201160411-ac50b-43c34e2a73477cde40f15887a810a7b365ec81c4.gz
2009-02-02 02:04:11 +10:00
axel
31439ffb52 Better warning message when trying to exit with jobs running. PAtch and suggestion from Josef Spillner.
darcs-hash:20090201151601-ac50b-64bf24877419a9087f37eda2486232dfdabea9d2.gz
2009-02-02 01:16:01 +10:00
axel
9111b85437 Fixed bug with configure.ac in autotools shipped with F10. This fix comes from James Reeves.
darcs-hash:20090201140928-ac50b-952a8ba0596e3cf4f4a4a94f226fd04ec607075f.gz
2009-02-02 00:09:28 +10:00
axel
c6427c5a47 Add mimedb infinite loop bug fix from James Reeves
darcs-hash:20090201133734-ac50b-96fb4735af616094ea57ba02266188f8a7038a0c.gz
2009-02-01 23:37:34 +10:00
axel
36c3bd4e8d Switch from ARG_MAX to getting value from sysconf, glibc no longer defines the latter. This was reported from Peter Alfredsen Matthew Wesley, among other people.
darcs-hash:20090201132329-ac50b-5b9d54731c2ea2da3868fd492e68628b7684bb76.gz
2009-02-01 23:23:29 +10:00
axel
dad549afd1 Fix slightly wrong LD_FLAG in Makefile
darcs-hash:20090201125628-ac50b-3e68d7165a6c19558c7c8d7189cb75d71b4a9875.gz
2009-02-01 22:56:28 +10:00
Ori Avtalion
e73c2be216 Add missing commas, letters and \c in the documentation
darcs-hash:20080210210053-57fc3-f7e03b3fca9dff8bdc02256dfb78478b68945015.gz
2008-02-11 07:00:53 +10:00
axel
b0d324f1a7 Fix dumb error causing fish not to compile...
darcs-hash:20080204230945-ac50b-a95529cf19c473f62b6104ae138cf8b8abcbd2ec.gz
2008-02-05 09:09:45 +10:00
axel
d7396ac59f Fix bug causing flood of error messages in terminal when trying to highlight an invalid command, reported by Denilson F. de Sa.
darcs-hash:20080204230905-ac50b-0829b69835347e5875656ae735181b724f10de2a.gz
2008-02-05 09:09:05 +10:00
liljencrantz
3f439e9cd3 Add quilt completions, written by Stefano Sabatini.
darcs-hash:20080123000021-75c98-b27ae979720c55ec2219f451c50e87e79fa38cd6.gz
2008-01-23 10:00:21 +10:00
liljencrantz
0b722864c0 Make string handling a bit more solid be making sure sb_printf returns a null terminated string even on failiure.
darcs-hash:20080120022045-75c98-a47aff63ce7278148ccf027d6ee3ff93b35ee350.gz
2008-01-20 12:20:45 +10:00
liljencrantz
75e26f0f94 Add completions for various user and group adding commands. Skip addgroup, since manual page was actually for adduser, most switches weren't applicable and I was too lazy to guess which ones.
darcs-hash:20080120020816-75c98-f937df6cb6789868a1385bfc3eb48f5ddefb3c43.gz
2008-01-20 12:08:16 +10:00
liljencrantz
8cacb33347 Add completions for m4
darcs-hash:20080119150149-75c98-d8e5060ef78c6103d51e453ee4d5265f0981c4af.gz
2008-01-20 01:01:49 +10:00
liljencrantz
bf7d62fd91 Add completions for badblocks
darcs-hash:20080119145849-75c98-657a11bc69fbf625b01f84f1f6638e0d4b767228.gz
2008-01-20 00:58:49 +10:00
liljencrantz
4ac31e637d Add completions for Battle of Wesnoth
darcs-hash:20080119145414-75c98-6d8f856062ea44cf5de56bb014765a65ac26706b.gz
2008-01-20 00:54:14 +10:00
liljencrantz
0ad64ad2e4 Improve documentaion for bind builtin, clarify how to specify key sequences.
darcs-hash:20080119003820-75c98-b1f9360ddab9206a1cdf77b94ce28e9978badb53.gz
2008-01-19 10:38:20 +10:00
liljencrantz
523096e5d8 Add simple git completions by Diggory Hardy
darcs-hash:20080118160327-75c98-33e4e011de409944143aecf4f7e7aa8995687c75.gz
2008-01-19 02:03:27 +10:00
liljencrantz
0de629e009 Fix spelling in docs and add a help page for the funced builtin. These changes where suggested by Emanuele Rusconi.
darcs-hash:20080118155413-75c98-eadff877b3af3c3271b098903f80a45082111424.gz
2008-01-19 01:54:13 +10:00
liljencrantz
1f6fa1208e Search for command-not-found in PATH on startup, since older implementations place it there
darcs-hash:20080115122953-75c98-05ef8cb650a942c59dfa35aa63b25ccd49614dde.gz
2008-01-15 22:29:53 +10:00
liljencrantz
b86856b454 In prompt_pwd, if a directory name starts with a dot, include first two characters. This patch was written by Denilson F. de Sá
darcs-hash:20080116223621-75c98-46f96c9f25d5e32cd10148d35713622e6eac50d7.gz
2008-01-17 08:36:21 +10:00
liljencrantz
6598320534 Remove useless stray argument in function call
darcs-hash:20080116222628-75c98-a307fbeacdd815edcedea05930dc8b4bb064acb3.gz
2008-01-17 08:26:28 +10:00
liljencrantz
0a66dc4a31 Correct completions for the function builtin
darcs-hash:20080116222602-75c98-c1a48b4a04fe71b25c5e004a282341148a95ab6d.gz
2008-01-17 08:26:02 +10:00
liljencrantz
88a2b622df Add more documentation on events
darcs-hash:20080116222531-75c98-ef30dabc492d7883dbb620c40ef95152469057a3.gz
2008-01-17 08:25:31 +10:00
liljencrantz
e10f75483f Fix minor bug, PWD was incorrectly set on startup
darcs-hash:20080116220738-75c98-2b7c886629857540efee8f1cab9da0aa9ed8f76d.gz
2008-01-17 08:07:38 +10:00
liljencrantz
1a66fc4c5d Drop vim feature of only completing text and gzip files
darcs-hash:20080116180249-75c98-2fdff83afcb286c7cc06d3ed66089c9cc02eca20.gz
2008-01-17 04:02:49 +10:00
liljencrantz
905b792de7 Improve code comment
darcs-hash:20080116010601-75c98-fc7e940543424479bf1016cec26af619f177f5fd.gz
2008-01-16 11:06:01 +10:00
liljencrantz
804f5ab334 Add an extra input validation check
darcs-hash:20080116010548-75c98-e6f198bb1eb5a456ce830c42f061428a9c6f755d.gz
2008-01-16 11:05:48 +10:00
liljencrantz
f974c7c416 Improve error messages on failed execve calls a bit more
darcs-hash:20080116010454-75c98-883050bf00f10bdb205724d7d273f10e6f0a1065.gz
2008-01-16 11:04:54 +10:00
liljencrantz
f3b6b74568 Oops. Made a minor but important typo in previous cleanup patch. :-(
darcs-hash:20080115004050-75c98-3f7f733cca054d8685ec5df68d6467057ea5be53.gz
2008-01-15 10:40:50 +10:00
liljencrantz
ab94a397c3 Drop minor typo, add a few code comments
darcs-hash:20080114225828-75c98-f67f17d7f3148b0bcc74ea53536d52da80667e55.gz
2008-01-15 08:58:28 +10:00
liljencrantz
537ab32dd9 Add support for the Ubuntu 'command-no-found' handler, which suggests a package to install in order to get a command.
darcs-hash:20080114223124-75c98-ab1658d54086394cf13f3a6210543c0b790362c4.gz
2008-01-15 08:31:24 +10:00
liljencrantz
a2660cfb76 Handle case insensitive completions of variables better
darcs-hash:20080114010032-75c98-6e570c2b095baeb2ed2ee4d09e32f4e7d6ae47de.gz
2008-01-14 11:00:32 +10:00
liljencrantz
3743a5758b The max size of the string buffer was too small. Push it up a bit.
darcs-hash:20080114005745-75c98-1bcad5c5e81d4257eb7e96e860f8c667f9ba3267.gz
2008-01-14 10:57:45 +10:00
James Vega
e510d10c77 Fixed various spelling errors.
darcs-hash:20080113200151-35ec8-c587f020aec07a5e613068677bd3dd4f5c6189ac.gz
2008-01-14 06:01:51 +10:00
liljencrantz
f5540ff958 Add canse insensitive tilde completion
darcs-hash:20080113193221-75c98-169804fe128001f73eaee6fab28bfb99dca7c93e.gz
2008-01-14 05:32:21 +10:00
liljencrantz
c2b28063e1 Improve Doxygen documentation generation a bit
darcs-hash:20080113164924-75c98-d9762465de42750728ac6cb9364f4739a29ae376.gz
2008-01-14 02:49:24 +10:00
liljencrantz
8d2564291d Make sure fish_indent handles io erros
darcs-hash:20080113164905-75c98-b090ce79fb50a260874951525218cac65a097a6d.gz
2008-01-14 02:49:05 +10:00
liljencrantz
87db9517e9 Add lots of new code comments.
darcs-hash:20080113164747-75c98-9d0cefd27be7aef7ba60772616d9da7e6bb52912.gz
2008-01-14 02:47:47 +10:00
liljencrantz
ab3502fc8b Bump version number
darcs-hash:20080113011626-75c98-5037824714b5f39b8e4786d724bd047275e4c718.gz
2008-01-13 11:16:26 +10:00
liljencrantz
22472ea980 Update todo list
darcs-hash:20080113011617-75c98-8a3bcc0b4a2c58e5f2b13c51f372e7349ffec32d.gz
2008-01-13 11:16:17 +10:00
liljencrantz
ef705be6a5 Raname main.c into fish.c. NAme makes more sense.
darcs-hash:20080112192135-75c98-dc3f8480f1b25f6ab866c252c7edace862298f38.gz
2008-01-13 05:21:35 +10:00
liljencrantz
d50fac7fe5 Update copyright dates
darcs-hash:20080112191848-75c98-2e9d03feebe185c70e63bbabb421ebb5ef248979.gz
2008-01-13 05:18:48 +10:00
liljencrantz
39c16a7770 Add check for existance of fish_greeting variable
darcs-hash:20080112185319-75c98-3b5231b1a956c94e8800dae033f3672622104340.gz
2008-01-13 04:53:19 +10:00
liljencrantz
2aad9d5a95 Fix silly type I caused when cleaning up ant completions. Thanks to Steven Knight for the report
darcs-hash:20080112184928-75c98-286284df7196a479c6a2789120705f1764d619b9.gz
2008-01-13 04:49:28 +10:00
liljencrantz
52aaf60510 Fix spelling, thanks to Chris Rebert
darcs-hash:20080112184042-75c98-1f776d6f099003efd9a0c4ed45100c3a02e80e19.gz
2008-01-13 04:40:42 +10:00
liljencrantz
3a2f7d0edf Add completions for the fish_indent command
darcs-hash:20080109031024-75c98-23e2782d68822c1005eb9766ae2d14e76ed5499b.gz
2008-01-09 13:10:24 +10:00
liljencrantz
605fffa9d2 Make sure the help switch to the cd command is not flagged as an error
darcs-hash:20080109030647-75c98-f82822cde746d1c8a89512481347061cfeb41e43.gz
2008-01-09 13:06:47 +10:00
liljencrantz
2229fad410 Fix bug in return and block builtins - they where unable to handle functions that do not shadow the calling scope
darcs-hash:20080109030136-75c98-05f7a48cd991ac24e15d7e8b580caef0396ff59c.gz
2008-01-09 13:01:36 +10:00
liljencrantz
8e9384e2e8 Update todo list again. :-)
darcs-hash:20080109020655-75c98-9255c6c2287859211af77869fe2eb77543390c03.gz
2008-01-09 12:06:55 +10:00
liljencrantz
394776c56b Update todo list and code comments
darcs-hash:20080109012338-75c98-745297861fd11ec82e062a79fe1d15c9084342f1.gz
2008-01-09 11:23:38 +10:00
liljencrantz
e3d3a1062d Dont change working directory during startup
darcs-hash:20080109004339-75c98-478d0024895b89e12d02f6f19273aa1f9df66ed9.gz
2008-01-09 10:43:39 +10:00
liljencrantz
b4042b18c6 Make sure case sensitive completions are ignored by the pager if case sensitive completions exist
darcs-hash:20080109000928-75c98-fc6dc6fcebca99f33a1ed484444efee87f5caa94.gz
2008-01-09 10:09:28 +10:00
liljencrantz
5379200b9e Make sure inserted completions are escaped, even when case insensitive
darcs-hash:20080109000046-75c98-baf9ef4594ad0c7024a79b5c4819c10c0697ba47.gz
2008-01-09 10:00:46 +10:00
liljencrantz
9c38ed8238 Improve ant completions. This patch comes from Steven Knight. (minor tweaks applied)
darcs-hash:20080108221608-75c98-a0c7f65c65fb2e2c68085c69e72caa4a2c86a029.gz
2008-01-09 08:16:08 +10:00
liljencrantz
cb59da7a6f Fix typo in docs on exporting rules. This issue was pointed out by Isaac Dupree.
darcs-hash:20080108213600-75c98-b68f1bc3846ca7050955ee0f133acd20282cb908.gz
2008-01-09 07:36:00 +10:00
liljencrantz
bdec900aca Minor doc updates
darcs-hash:20080108210918-75c98-7510c066f74a2c3f4bf60bda84237adcef2ca276.gz
2008-01-09 07:09:18 +10:00
Nicholas Burlett
564d19e3bd The ability to switch to sh for processing files starting with a ':' broke
recently, as the incorrect arguments were being passed to execve. The
function went through the trouble of creating the proper arguments, and
then failed to use them.

darcs-hash:20080104015631-2d839-1d79a7810fcc3e2a3788dabdbc22d13a4bd4f404.gz
2008-01-04 11:56:31 +10:00
liljencrantz
063c4d7e67 Add comment on CDPATh being a universal variable after comments from Isac Dupree.
darcs-hash:20080107235427-75c98-3f56a4f450bb9beb66c9949c9313a1991754d8fb.gz
2008-01-08 09:54:27 +10:00
liljencrantz
30cfa2a445 Add explanation to csh versus sh variable naming in docs.
darcs-hash:20080108194127-75c98-b44c6f18607cf270fae16179cd0df3e84f980b91.gz
2008-01-09 05:41:27 +10:00
liljencrantz
71c2cde390 Cleanup and improve the exit status numbers and the messages generated on error as well as make sure that keyboard shortcuts don't change the status
darcs-hash:20080108193145-75c98-56c8aa2dd081af643d206820aa36bf3b6e49e0f2.gz
2008-01-09 05:31:45 +10:00
liljencrantz
da4a4bcc18 Only set various startup defaults once. Even if the user removes them, do not try to reset them.
darcs-hash:20080108161856-75c98-7d228f7a0c62aa8be74f66ce72d0cadbc3030f5d.gz
2008-01-09 02:18:56 +10:00
liljencrantz
286ce1d6a4 Only set the fish greeting variable on the very first startup
darcs-hash:20080108152708-75c98-d1aa82fbcf070b74f402a6b33e687ccf615fb104.gz
2008-01-09 01:27:08 +10:00
patroclo7
5064cec16d makepkg-completions
Completions for makepkg, the archlinux tool to build packages from source

darcs-hash:20071218002337-782a0-b2f26f1e8ed35e6180785f077a7a0af99f5ea804.gz
2007-12-18 10:23:37 +10:00
patroclo7
f5f5e63ddf pacman-completion
Completion definitions for the pacman package manager, used by Archlinux.

darcs-hash:20071217231409-782a0-c17d12806fcd9732578a878b827af4074577c177.gz
2007-12-18 09:14:09 +10:00
patroclo7
ae878ed6ea option-absent-function
Add a function which checks that an option has not been used (useful to avoid
incompatible combinations of options and necessary for the completions for
the pacman package manager.

darcs-hash:20071217230315-782a0-be39b1258832f0d2427765200d051e5d688b041b.gz
2007-12-18 09:03:15 +10:00
liljencrantz
2c5151bb78 Fix bug in key binding code causing unneeded error messages
darcs-hash:20071031091503-75c98-3ab5786c1f991e4ea37c33b76823a487f25fab64.gz
2007-10-31 19:15:03 +10:00
liljencrantz
f506f1f495 Remove unneeded code
darcs-hash:20071028233214-75c98-0b98df754e50f6fb937098506884b1d526bf15fd.gz
2007-10-29 09:32:14 +10:00
liljencrantz
374fc09af0 Minor tweaks for man page parser.
darcs-hash:20071028233110-75c98-7d900290fdb313cb8ce2194a2d452cd9d4c8dc13.gz
2007-10-29 09:31:10 +10:00
liljencrantz
54b1986986 Add command specific comlpetions for cowthink
darcs-hash:20071028230807-75c98-1706c8b0f2559c2f5fa9e6055c7aa60e8fc4a2f6.gz
2007-10-29 09:08:07 +10:00
liljencrantz
6e9489f4f5 Add command specific comlpetions for cowsay
darcs-hash:20071028230620-75c98-d137040e58b76a570234eb15603192922c4cfe01.gz
2007-10-29 09:06:20 +10:00
liljencrantz
a52bd219b9 Remove lots of things from the todo which have been implemented
darcs-hash:20071028190344-75c98-9ccc5b5dab1f788c5179d5a527e6823d207f832e.gz
2007-10-29 05:03:44 +10:00
liljencrantz
bdd1b6b4b2 Rewrite automatic completion creator from scratch. The new implementation uses a finite state machine instead of a set of regexes, which inpractice seems to make the parser more robust and the code subjectively more readable
darcs-hash:20071028185143-75c98-92c1a0cd579ff0c41f47e75c975405fe3e002ddb.gz
2007-10-29 04:51:43 +10:00
liljencrantz
6dfdb3ba6e Remove bad completion for bison
darcs-hash:20071028184743-75c98-2f74b81cb8bfe7fe7346aa65b652d6bbe8eac4a1.gz
2007-10-29 04:47:43 +10:00
liljencrantz
48d5637178 Add command specific comlpetions for gdb
darcs-hash:20071028184722-75c98-a2822e20d772dde73ef13a6ce7ca56339b13864f.gz
2007-10-29 04:47:22 +10:00
liljencrantz
d724b160ea Add command specific comlpetions for chmod
darcs-hash:20071028183924-75c98-e73d8ce3ba9da36a70ef849df3c309f9f188ba68.gz
2007-10-29 04:39:24 +10:00
liljencrantz
7a4dc6f700 Add command specific comlpetions for bison
darcs-hash:20071028183548-75c98-0027c86d0077004b7bb0408358ba3821772b2374.gz
2007-10-29 04:35:48 +10:00
liljencrantz
c9f43fb02d Add command specific comlpetions for awk
darcs-hash:20071028183140-75c98-0c649a62488fa155d8170ac04a876b9ab426dbc0.gz
2007-10-29 04:31:40 +10:00
liljencrantz
da02905250 Add command specific comlpetions for acpi
darcs-hash:20071028182810-75c98-fc6cb8818dc8a93976802c255584cfd9c86a8958.gz
2007-10-29 04:28:10 +10:00
liljencrantz
80060229f8 Minor simplification to rpm completions
darcs-hash:20071028182440-75c98-dc3d22f37e1779dca7e2e88f02fc9e0d815301c9.gz
2007-10-29 04:24:40 +10:00
liljencrantz
10b9b06ef7 Add command specific comlpetions for scons
darcs-hash:20071028182413-75c98-41bf654fd8fe0522a8ebae19b6ecaa8a4d1f2d8c.gz
2007-10-29 04:24:13 +10:00
liljencrantz
e9aba6a878 Add command specific comlpetions for xgettext
darcs-hash:20071028180724-75c98-42c8d8a3810f6bdaee4ac90da1cc34371fcfacf4.gz
2007-10-29 04:07:24 +10:00
liljencrantz
5fee5a2890 Add command specific comlpetions for msgfmt
darcs-hash:20071028095834-75c98-d749a3fef8e28c9d5bab1cd3dfbf989aac9a8049.gz
2007-10-28 19:58:34 +10:00
liljencrantz
3f3fe634c8 Do not use carriage return in translated strings
darcs-hash:20071028091145-75c98-fc211f29b5c96fa5e10cedd848dabb0a664a34b7.gz
2007-10-28 19:11:45 +10:00
liljencrantz
a5156c54cb Make sure configuration files are only run once
darcs-hash:20071028091117-75c98-735febed13f816e2870e90324758ec59d713b1e2.gz
2007-10-28 19:11:17 +10:00
liljencrantz
74cd64ba21 Make sure that function and completion paths contain contain the basic fish completions/functions on startup.
darcs-hash:20071028091042-75c98-4e201b1b39c7c7b66ff9ec71f95b05f8d6d42708.gz
2007-10-28 19:10:42 +10:00
liljencrantz
348e991d7c Indentation fixes, add a few comments, spelling, etc.
darcs-hash:20071028090840-75c98-2ae076441517cd7a0d8172fad28edaf6f034b70c.gz
2007-10-28 19:08:40 +10:00
liljencrantz
a1af86cb6b Remove non-ascii characters from completions
darcs-hash:20071028090802-75c98-06f7a48a6a5590117c0293dc75b07846e86a34a1.gz
2007-10-28 19:08:02 +10:00
liljencrantz
baa6a40d6f Fix completion bug - case insensitive competions of command names sometimes got the path prepended to them
darcs-hash:20071028090605-75c98-b623c6bf3f5a5144cdecaf0c005d4acb980e33f1.gz
2007-10-28 19:06:05 +10:00
liljencrantz
5082054bcb Some polising of english and swedish translations
darcs-hash:20071028010624-75c98-2943272173fa60e70e9e947e34a2ed05296156a7.gz
2007-10-28 11:06:24 +10:00
liljencrantz
2160777d2f Implement non-clobbering file io. Use the >? operator for this for now.
darcs-hash:20071026184232-75c98-11edcbc7548c8ad3a2d4b648cb7ae18067569f02.gz
2007-10-27 04:42:32 +10:00
liljencrantz
a97faaf664 Indentation fixes.
darcs-hash:20071015132125-75c98-c59b345017f97ac4fe9bb166bf5128245a66e05a.gz
2007-10-15 23:21:25 +10:00
liljencrantz
0c1b40e3b3 Fix swallowing of last line on prompt display. Again. How many times have I triggered this bug?
darcs-hash:20071015132106-75c98-11863d8b1743b84f6ad448b64e5ccdeb5aaa5a2f.gz
2007-10-15 23:21:06 +10:00
liljencrantz
e54ce9a147 Minor bug fix - the parse_util_set_argv function can trigger an event, hence signals have to be unblocked when it is called.
darcs-hash:20071015132006-75c98-4ec10e4e26ea63c86c57f7e1f24f3d0fc60995b5.gz
2007-10-15 23:20:06 +10:00
liljencrantz
36e08dc49e Make the maximum execve size test use sysconf. Create a fallback if sysconf is unavailable.
darcs-hash:20071015113936-75c98-078e9f8727e91d41fabc80827bf97c8e04dd97ba.gz
2007-10-15 21:39:36 +10:00
liljencrantz
dd02e96712 Second part of improved execve errors - this patch makes the memory limits nicely formated (e.g. 128kB instead of 136549 bytes).
darcs-hash:20071015095108-75c98-51c2ea6ab6edba5d1885eb5938f039054da775e2.gz
2007-10-15 19:51:08 +10:00
liljencrantz
4163040e56 First stab at better error reporting on too many arguments to execve.
darcs-hash:20071015093615-75c98-2137b887ca3c97bc3e4234e2fd14a1391b4cc85a.gz
2007-10-15 19:36:15 +10:00
liljencrantz
0bea4c46e3 Add very minimal fallback keybindings
darcs-hash:20071015085130-75c98-1c91b5d8cc1227f15d5de68b85af2ceadbf66e31.gz
2007-10-15 18:51:30 +10:00
James Vega
0f6fe652a4 Use wcscmp instead of
darcs-hash:20071013212606-35ec8-ba25df01017fb1c272ea9dae059fb4245e4c02da.gz
2007-10-14 07:26:06 +10:00
James Vega
afa0ed124f Check whether '$TERM' starts with 'screen' instead of whether it's an exact match when determining if \ek\e\\ should be recognized.
There are various terminfo entries for screen that should be recognized aside from simply 'screen' such as 'screen-256color' and 'screen-bce'.

darcs-hash:20071013184358-35ec8-5e85add3cc1667781590e12118a98ec6641bc714.gz
2007-10-14 04:43:58 +10:00
liljencrantz
8904ab47aa Remove mention of fish_inputrc in install scripts. The file no longer exists.
darcs-hash:20071014115259-75c98-f43cd2358ddd15b28eba4d47de383bef8c794615.gz
2007-10-14 21:52:59 +10:00
liljencrantz
25305c6b24 Fix bug in pager causing some keybindings to be ignoerd because other are undefined
darcs-hash:20071014111640-75c98-c4d271f9b033a4f644e1b58cdb2e8842aff198d2.gz
2007-10-14 21:16:40 +10:00
liljencrantz
89c27c6d9d Indentation fixes
darcs-hash:20071014101502-75c98-5767d159d7c10deda49c23ad9e3758d93024950f.gz
2007-10-14 20:15:02 +10:00
liljencrantz
175dd75a3d Tiny touchups of docs and code
darcs-hash:20071006105527-75c98-339c5d7ec2fbae0c2d4dc93552db85c389971a6a.gz
2007-10-06 20:55:27 +10:00
liljencrantz
9b74687384 Minor new sanity test in reader
darcs-hash:20071006105453-75c98-3f5d1a0a175a7b810f68b38dec472bb697081742.gz
2007-10-06 20:54:53 +10:00
liljencrantz
fcd474afe8 Make completion system not use quoted string escapes, since it generally looks a bit confusing there
darcs-hash:20071006105131-75c98-af770878124cc19946b964c0cf772818a5bf4216.gz
2007-10-06 20:51:31 +10:00
liljencrantz
3ca3b6209d Make the Alt-p keybinding respect the PAGER variable
darcs-hash:20071006103231-75c98-59ef22ad49526f52cff8a97d9fac9f003af19213.gz
2007-10-06 20:32:31 +10:00
liljencrantz
9299515f3e 'Misfeature' fix for eval function - make it force job control when in interactive mode, in order to make commands that expect to control the terminal happy
darcs-hash:20071006102326-75c98-b168d709d54edb21c478ec2d69420468a2c08da1.gz
2007-10-06 20:23:26 +10:00
liljencrantz
188f0454b7 Use IO redirection to make the eval function actually have a working stdin
darcs-hash:20071005150245-75c98-d6a6d2f6ec1690079ee30f0e9cccf61e30e14c08.gz
2007-10-06 01:02:45 +10:00
liljencrantz
e55739296d Don't crash when trying to close fds for a builtin command
darcs-hash:20071005150106-75c98-292df3863252c1eebd5734a241a2d80e6883f65f.gz
2007-10-06 01:01:06 +10:00
liljencrantz
68857220ac Make fish automatically realise a repaint is needed in more situations, making many keybinding calls to 'commandline -f repaint' unneeded
darcs-hash:20071005145919-75c98-ce349d3718e54df30a050b97afee48b56ab46348.gz
2007-10-06 00:59:19 +10:00
liljencrantz
713c84d821 Make the . builtin have a more useful (and posix-compatible) exit status
darcs-hash:20071005145808-75c98-17100c1e321b8bca06f75e900db1386451232f98.gz
2007-10-06 00:58:08 +10:00
liljencrantz
d34d05ca8b Comment updates, minor code cleanups and other janitorial jobs
darcs-hash:20071002100937-75c98-d4040e70a256e36a6334cca0a05d60500680132b.gz
2007-10-02 20:09:37 +10:00
liljencrantz
dac2129048 Minor comment updates and code tweaks in input code
darcs-hash:20071002092838-75c98-d98cf339d971128761f65f6878651bd7069f9f59.gz
2007-10-02 19:28:38 +10:00
liljencrantz
8cd8c3002e Actually make the previously defined function for reloading key bindings on chage of function into an event handler as intended...
darcs-hash:20070930225557-75c98-284157fbbc56effe781bf26c21499a8e5586e563.gz
2007-10-01 08:55:57 +10:00
liljencrantz
4b85eb32d7 Remove readline legacy input function 'winch' and replace its functionality with an event handler function. Once again make the null keybinding do nothing. There are various sitauations where you want to perform a repaint at just the right time, and more or less by luck it worked very well to do this on null, but this really shouldn't happen and no longer does. Hopefully if new repainting issues turn up, they can be fixed at the root instead of once again reapplying this broken bandaid.
darcs-hash:20070930225354-75c98-8e2b518aa0ef694cee889c1c599ff4f158d9eb7f.gz
2007-10-01 08:53:54 +10:00
liljencrantz
5870ee7723 Add input function completions for the commandline builtin
darcs-hash:20070930074204-75c98-670704072134326d281626dcc6c1e7dc5be66140.gz
2007-09-30 17:42:04 +10:00
liljencrantz
feec9579c2 Drop the unneeded input-function delete-line. It was only there for compatiability with readline, which we have dropped.
darcs-hash:20070930073018-75c98-d3abd6e63797c4954778486064f5f55a718f066c.gz
2007-09-30 17:30:18 +10:00
liljencrantz
dde3838f2d Drop the unneeded input-function exit. It was only there for compatiability with readline, which we have rdropped.
darcs-hash:20070929072114-75c98-db188ce2bc31a0668867f9de05ffeed098b988c2.gz
2007-09-29 17:21:14 +10:00
liljencrantz
97b77d1b3a Indentation and comments
darcs-hash:20070928213922-75c98-96ae445e28ad3273c98ddc4ca16597988eb66d37.gz
2007-09-29 07:39:22 +10:00
liljencrantz
addb5a698d Add a few extra directories to check for in path on startup
darcs-hash:20070928213855-75c98-3670b961e1b16bfdc952bbd8e6eccacdc368ff6b.gz
2007-09-29 07:38:55 +10:00
liljencrantz
db0a982570 Make path checking on startup faster by only using builtin commands
darcs-hash:20070928213821-75c98-65fb9e2159bfef7ab04468511378ac3efbf2308e.gz
2007-09-29 07:38:21 +10:00
liljencrantz
3a73b60956 Ignore errors when autoloading keybindings
darcs-hash:20070928213741-75c98-8339e7f5f5b465af315efd606fe866624f958320.gz
2007-09-29 07:37:41 +10:00
liljencrantz
f4f10a8226 Documentation improvements on new key binding system
darcs-hash:20070928213654-75c98-a4845fb417b0b29a75d4a337df18250bc488e271.gz
2007-09-29 07:36:54 +10:00
liljencrantz
d6c7e25bea Add more keys to list of kes supported by 'bind -k'
darcs-hash:20070928213616-75c98-35f276b1c34b54684ee48681e6a04375cd3152c5.gz
2007-09-29 07:36:16 +10:00
liljencrantz
f28e83d3e9 Improve error reporting for bind builtin
darcs-hash:20070928213523-75c98-bd88022a63af1409ae28ae0829280df9652dcaff.gz
2007-09-29 07:35:23 +10:00
liljencrantz
0e716763d8 Replace variadic functions like sb_append and contains_str with variadic macros without a sentinel.
darcs-hash:20070928213227-75c98-2e7b06242acfd5fd0bf02ce77c41d52374f2363a.gz
2007-09-29 07:32:27 +10:00
liljencrantz
50f5941a82 Drop tokenizer.o from list of objects to include into fish_pager, since it wasn't actually used. Reduces size of pager binary by a few kB.
darcs-hash:20070926092957-75c98-393fa9d6ddb97a60fd0a8f5e86a2de6d2422e23b.gz
2007-09-26 19:29:57 +10:00
liljencrantz
093cb71f91 Fix bug in exit code that made the exit builtin exit even if there where running jobs if called directly from the commandline
darcs-hash:20070926090159-75c98-2760c6c24e21fd14711c9ce3bef1b0890b495d65.gz
2007-09-26 19:01:59 +10:00
liljencrantz
df4fdf33c4 Make escaping of the empty string return two quotes instead of the empty string
darcs-hash:20070925161959-75c98-1a0409c5fd12c7570e54cbdd9201548c7405196b.gz
2007-09-26 02:19:59 +10:00
liljencrantz
5694d3f027 Make escaped strings more readable
darcs-hash:20070925161916-75c98-c33aa140fb099f2003e5af3dadb5f613075b59d6.gz
2007-09-26 02:19:16 +10:00
liljencrantz
cf8e746d0c First stab at dropping all support for readlines inputrc files and instead using an internal system for performing keybinding.
darcs-hash:20070925161447-75c98-1feaef88a4b518badb7879f598f06ab650a8f93b.gz
2007-09-26 02:14:47 +10:00
liljencrantz
af9c2067e1 Add missing escape highlighting for \c-style escapes and a few other escape codes
darcs-hash:20070925115514-75c98-3959f8729d32585232d191b4eead83935b36bff1.gz
2007-09-25 21:55:14 +10:00
liljencrantz
d44dd73682 Improve documentation in screen handling code
darcs-hash:20070924085602-75c98-0a60a87de51e0dbf7e64221b0382401e72745465.gz
2007-09-24 18:56:02 +10:00
liljencrantz
5938a93018 Make prompt have its own line if we things don't fit on a single line
darcs-hash:20070924084933-75c98-0b139cdab5da3f9c9f358d09275ed15fc0fbba52.gz
2007-09-24 18:49:33 +10:00
liljencrantz
79ac330afb There code for detecting when a keepalive process was needed missed lots of cases. This should fix some issues. Both the keepalive code and the code for spawning fake processes for builtins should be rethought, though.
darcs-hash:20070924082144-75c98-ab62f758374952aa3b295af709d57931972f4683.gz
2007-09-24 18:21:44 +10:00
liljencrantz
e6764f3130 Improve commenting a bit
darcs-hash:20070924081823-75c98-20dee07adff34f2337c56b30f1e453cc38f40639.gz
2007-09-24 18:18:23 +10:00
liljencrantz
710a01c945 Improve error reporting in the . builtin
darcs-hash:20070924081428-75c98-72b9f1dfe64a40b0f7893c9ebcb59f477f6c924c.gz
2007-09-24 18:14:28 +10:00
liljencrantz
0b7b20f013 Make sure that ouput with no trailing newline is not eaten. This is a regression bug fix.
darcs-hash:20070924081301-75c98-86bd87a9323044807e78b8eb904bd6c5830ee23f.gz
2007-09-24 18:13:01 +10:00
liljencrantz
819c20e1d8 Fix bug causing some fish strings not to be translated
darcs-hash:20070923211111-75c98-3bac272b81c4af4e18968a532987d9a7be1c273a.gz
2007-09-24 07:11:11 +10:00
liljencrantz
61ebc12dd4 Minor polish like adding missing whitespace, switch to using --argument switch in function definitions to make code more readable, add a few minor saftey checks, etc.
darcs-hash:20070923210730-75c98-88557ba8b6020cae04a5e437c6bb6370e39c04d9.gz
2007-09-24 07:07:30 +10:00
liljencrantz
449a75756d Fix narrow/wide encoding issues found through new test suite additions
darcs-hash:20070923210007-75c98-9ffee3b8f1ce24e1d6f178baa1f2ef52d70ee38b.gz
2007-09-24 07:00:07 +10:00
liljencrantz
5e2e9e2b9b Add escape/unescape and wide/narrow conversion tests to the test suite
darcs-hash:20070923205918-75c98-1456ea86764a6a414f94c30e16aa2918b8341be1.gz
2007-09-24 06:59:18 +10:00
liljencrantz
737935ebe4 Fix bug caused by new escap beutification code. Some strings containing a single quote where incorrectly escaped.
darcs-hash:20070923145555-75c98-1125e148af36cb1bbe2f2029c3f1d118308721a6.gz
2007-09-24 00:55:55 +10:00
liljencrantz
0679a6351f Fix bug making builtin help for the '.' builtin not show up.
darcs-hash:20070922223828-75c98-41cf335992cd61ef5c958889714766c513d5d5f7.gz
2007-09-23 08:38:28 +10:00
liljencrantz
657e3f8147 Whitespace fixes, etc.
darcs-hash:20070922222041-75c98-5aeb13041abd7ca8f9989e209fbaa5441fa78756.gz
2007-09-23 08:20:41 +10:00
liljencrantz
e6b9955fc1 Add switch fo scope hiding in output of functions builtin
darcs-hash:20070922221920-75c98-7a17d24162a3fbdfd9c05690d2358511a3ca0281.gz
2007-09-23 08:19:20 +10:00
liljencrantz
e1afe17671 Fix bug in eval function, forgot to turn off new scope creation.
darcs-hash:20070922193055-75c98-ea4a37e3ba1bce4da7d2b65ef464740cc67822e2.gz
2007-09-23 05:30:55 +10:00
liljencrantz
16e2c4805a Use quoted escaping if possible. Most people find that more readable.
darcs-hash:20070922190838-75c98-635f62df48d611be05892c09e135e8a3993e76b2.gz
2007-09-23 05:08:38 +10:00
liljencrantz
5ecd0e22bf Remove a few calls to the test command in favour of the switch builtin to speed statup up
darcs-hash:20070922190734-75c98-0e63a0ed6685edc2c9aa941f0b26c14466c7af6a.gz
2007-09-23 05:07:34 +10:00
liljencrantz
1420744669 Fix rather large performance issue on systems with slow fork syscall - a fork was used whenever redirecting output to /dev/null and using a builtin, completely unneeded.
darcs-hash:20070921214955-75c98-b513df263751506e5e82f97eafa08041228bc8de.gz
2007-09-22 07:49:55 +10:00
liljencrantz
048f903a9d Create common function for listing available character encodings, make sure it is used in all relevant places.
darcs-hash:20070921211051-75c98-5ff21df5b29e8a66ef0c4488afb96acfdb6f74a2.gz
2007-09-22 07:10:51 +10:00
liljencrantz
dab7e6c7b9 Move mkae completion function to its own file
darcs-hash:20070921210401-75c98-6b303317ba375f0c6402e81902e599e79a9c06ed.gz
2007-09-22 07:04:01 +10:00
liljencrantz
06de2602cb Clean up interactive mode init a bit. Move a few utility functions to their own files.
darcs-hash:20070921205212-75c98-b8b6f88e151e8d0d2fca21626bf8e36a22c565b1.gz
2007-09-22 06:52:12 +10:00
liljencrantz
65d223e672 Make sure all keybinding scripts repaint properly
darcs-hash:20070921151723-75c98-83f2fe86ace0f6e567db26faa4d94665971af145.gz
2007-09-22 01:17:23 +10:00
liljencrantz
c0aac8996d Improve documentation for breakpoint builtin
darcs-hash:20070921151654-75c98-550df5aebaa11855c53585202ab7fafe7c5820ad.gz
2007-09-22 01:16:54 +10:00
liljencrantz
3692074e7e Make R_NULL not repaint and document the fact that this means some keybindings need to manually tell fish to repaint
darcs-hash:20070921144426-75c98-7db4351e14733e2c18e44515e8ed78b1f1faea80.gz
2007-09-22 00:44:26 +10:00
liljencrantz
954c99a5ad Minor improvement to docs for count builtin
darcs-hash:20070921144301-75c98-02d497e712c6932322a74d82fc7a772c92e19552.gz
2007-09-22 00:43:01 +10:00
liljencrantz
8c4770a26c Add boilerplate definition when using funced on undefined function
darcs-hash:20070921142954-75c98-752f389dfe4022ea3e72092bb717a60314408d41.gz
2007-09-22 00:29:54 +10:00
liljencrantz
624878d35f Minor bug correction in new cursor movement code.
darcs-hash:20070921142301-75c98-7fc9bbdf1591e0fc24a562e69bf483845a160df5.gz
2007-09-22 00:23:01 +10:00
liljencrantz
2375578310 Add a few comments, remove debug message add function descriptions to up-or-search and down-or-search shellscript functions
darcs-hash:20070921141121-75c98-0c6b3970f766429ba5e5c674ab3f6283f1f8824c.gz
2007-09-22 00:11:21 +10:00
liljencrantz
084c0c5f80 Correct minor typos, stupid error messages, indentation and drop unused variable.
darcs-hash:20070921140752-75c98-74318b9daffa071845187bcc0b72259ca37b7e18.gz
2007-09-22 00:07:52 +10:00
liljencrantz
d2d397d9eb Make up/down cursor move up or down when in multiline mode, except if already in search mode or at the top/bottom line. Since part of this is done in script-space, this involves adding some functionality to the commandline builtin.
darcs-hash:20070921140549-75c98-ba9e83f5e6fdecae5df8f83dd863794c6af9770c.gz
2007-09-22 00:05:49 +10:00
liljencrantz
607e970659 Further improve accuracy of cd builtins error messages. Now correctly reports rotten symlinks.
darcs-hash:20070920175243-75c98-e210034c7bfc8308be9e03017a5a0d8ef7648b9c.gz
2007-09-21 03:52:43 +10:00
liljencrantz
3b39b1fa03 Significantly improve accuracy of error reporting in the cd builtin
darcs-hash:20070920172928-75c98-826cd86e1c33e1f6c746227655e340a6bb459f30.gz
2007-09-21 03:29:28 +10:00
liljencrantz
64933d31a6 Remove generated versions of scripts on 'make clean'
darcs-hash:20070920172500-75c98-29ba72a339c3681a5eb20cd346a9a877618813cb.gz
2007-09-21 03:25:00 +10:00
liljencrantz
c780f1a8c9 Do not use enter/exit_ca_mode if they don't exist in fish_pager
darcs-hash:20070909140641-75c98-7c7ff3fae5be6432998a30c51ad90ae4c6e3babe.gz
2007-09-10 00:06:41 +10:00
liljencrantz
76bb8e79b2 Add better debbuging information when writembs is called with null value.
darcs-hash:20070909140436-75c98-b6c925c441ebaa349f998b95314295296fb36252.gz
2007-09-10 00:04:36 +10:00
liljencrantz
370aeec44d Fix bug in the count builtin, causing it to exit with status 0 even if no arguments where given
darcs-hash:20070909135734-75c98-2d0495a15440e50fb6521bffef85147832771c80.gz
2007-09-09 23:57:34 +10:00
liljencrantz
b0ae3dc9cc Handle merge confligt for previous patches. The exact same bug was fixed twice.
darcs-hash:20070908222725-75c98-2e1d0b090608d71f452c6ba7c3e1281782ebec11.gz
2007-09-09 08:27:25 +10:00
axel
a900d16540 Fix insane bytemark issue on Solaris
darcs-hash:20070908191940-ac50b-f99e05c86f32a5c1c1aff35c1916951269a54d54.gz
2007-09-09 05:19:40 +10:00
axel
3fc1ba0f0e Fix incorrect escape character in unescape function
darcs-hash:20070908191855-ac50b-e98e433dc23b6357c3a23d935de4bcb55efb9da9.gz
2007-09-09 05:18:55 +10:00
axel
38ed4c0f9b Avoid void pointer arithmetic in halloc.c
darcs-hash:20070908191814-ac50b-bb024c5a7ee878810bc7e12dcbcce32ff0145090.gz
2007-09-09 05:18:14 +10:00
axel
5a61ae3e0d Avoid magic number in main.c
darcs-hash:20070908191743-ac50b-7185b9d59122cb9a090cacfbb43266822400e1ed.gz
2007-09-09 05:17:43 +10:00
axel
c9fe154c01 Avoid using test command in prompt, makes it slightly faster
darcs-hash:20070908191717-ac50b-c2d936bff0e7aead0aecad6aa9e024e63b72fc97.gz
2007-09-09 05:17:17 +10:00
axel
2a3b01a7a0 Avoid using -n switch to ecco
darcs-hash:20070908191554-ac50b-22f205c0da9dde0cbe19154ee6f4f64fed49241a.gz
2007-09-09 05:15:54 +10:00
Claes Nästén
c2c4b24174 Fix issue in error handling, reported to and fixed by Axel Liljencrantz. Change val[0] and body[0] in env universal to val[1] and body[1] to support compilation with Sun Studio. Change default prompt to use pekdon instead of whoami as it does not exist under Solaris.
darcs-hash:20070822080052-cac88-326332f0df7d17ddca4a4496c93728a47f19bba5.gz
2007-08-22 18:00:52 +10:00
Claes Nästén
74a270ea32 Add tparm fallback to use under systems having tparm with fixed number of paramters, required with Solaris curses. Updated configure script to check for c99 for compilation with Sun Studio under solaris and updated LDFlAGS for fish_pager etc to include library dependencies from common.c etc.
darcs-hash:20070822075741-cac88-5532b074490bce1d7f37289b1774a4a5e44416d8.gz
2007-08-22 17:57:41 +10:00
Claes Nästén
2994378e1a Fix compilation with Sun Studio compiler changing \e to \x1b as it does not support \e as an escape character.
darcs-hash:20070822075239-cac88-1a9768bf35295615d553192d9a494f00db26f742.gz
2007-08-22 17:52:39 +10:00
Claes Nästén
baeca81305 Fix compile issue with Sun Studio, read_redirect returns void still doing return read_direct breaks with error about returning from function returning void.
darcs-hash:20070822074900-cac88-95305ba9542eec028dc7e6bb462aab10897fb693.gz
2007-08-22 17:49:00 +10:00
liljencrantz
151943f89e Indentation, typo and formating fixes. Very minor patch.
darcs-hash:20070908222453-75c98-2236d962f0c9016820063e871fbbeaa42f36ef22.gz
2007-09-09 08:24:53 +10:00
liljencrantz
ad02bb9b48 Add a 'generic' type of event that can be emited from any piece of code or by the user. Use this event layer to perform interactive configuration startup at the correct time.
darcs-hash:20070819164230-75c98-f91b8a73de7bbbb500d80770ddf4d2d46ae592cc.gz
2007-08-20 02:42:30 +10:00
liljencrantz
e464b4270c Make the prompt different when root user. This change was suggested by Claes Nästén.
darcs-hash:20070818230302-75c98-8015683bda0bc75aeab048e2f6509afc9809ffa1.gz
2007-08-19 09:03:02 +10:00
liljencrantz
e076f2c239 Make the contains builtin not allow reordering of switches and non-switches
darcs-hash:20070814214257-75c98-a50161a8146dfd0a6c6a948e1960f93dd52275fd.gz
2007-08-15 07:42:57 +10:00
liljencrantz
3cb24e0681 Add missing file creation mask for open. This fixes a compilation bug on the upcoming Fedora 8. Thanks to Oliver Falk for reporting the issue as well as figuring out the cause.
darcs-hash:20070814213722-75c98-5466a6be1e29984da67d5de0d1fe8e04ec1373bb.gz
2007-08-15 07:37:22 +10:00
patroclo7
27baa6e62b Completions for prt-get and pkgutils, the package management utilities for CRUX (Giorgio Lando)
darcs-hash:20070803202253-782a0-e2140559cdf45e3a543c3e9d915fe84537ee73a6.gz
2007-08-04 06:22:53 +10:00
Giorgio Lando
fa9d00a81a Completions for ports, a tool for port management in CRUX linux
darcs-hash:20070804110916-cbd54-5a9d129b9cfc7bf1b8f09248631ddbfbfc0dda22.gz
2007-08-04 21:09:16 +10:00
liljencrantz
04948702e0 Add a mino-prompt when the normal prompt is too large to display. The old behaviour was to simply not print any proimpt, but that lead to thinking fish had hanged since there was no prompt at all.
darcs-hash:20070802225939-75c98-16623ffd640c6036331844334b0ff6f9f211934d.gz
2007-08-03 08:59:39 +10:00
liljencrantz
20526687b2 Drop contains function, since we now have a builtin.
darcs-hash:20070801225554-75c98-cbaba63efdd06277364cc9b3ef871b9e76a7edb9.gz
2007-08-02 08:55:54 +10:00
liljencrantz
0a0870180d Fix duplicate switch antry in builtin_status. Don't know if this was caused by patch bug or typo.
darcs-hash:20070801225421-75c98-8c91f5fb00ccc05ac40ef12ffbfc68fec5e64dd0.gz
2007-08-02 08:54:21 +10:00
liljencrantz
972edef341 Replace the contains function with a builtin for performance reasons. The contains function used at lots of forks, which was noticable on systems such as OS X with slow forks, as well as on completions that do a lot of tests, like svn
darcs-hash:20070801225318-75c98-48cc4d685ab665c7c2eb93ac3c374bf5afecd28a.gz
2007-08-02 08:53:18 +10:00
James Vega
8ed521c817 Update status builtin to properly handle and document all of its options.
darcs-hash:20070801194450-35ec8-e2fe5b798e728d1caef474295a92230c35c79c17.gz
2007-08-02 05:44:50 +10:00
axel
88199d6b51 Implement a minimal 'dumb terminal mode'. This mode is used to at least get the relevant information on-screen when using a dumb terminal, though the interface is pretty crippled.
darcs-hash:20070801190754-ac50b-4a07ba05455f3ff55e337a78320dc4302cd3502c.gz
2007-08-02 05:07:54 +10:00
axel
782a739736 Remove confusing and misleading error message when trying to repaint the prompt during startup, reported by Chris Rebert.
darcs-hash:20070801180901-ac50b-43abf47182fcaa19fdbd993d480ac07f2915b6ed.gz
2007-08-02 04:09:01 +10:00
axel
cd19320ab2 Minor bug fix in mime-completion-filter - correctly handle when there is no mimetype
darcs-hash:20070801173955-ac50b-0459fc6049e9ee1907c368b8a5a01b6aa1973e45.gz
2007-08-02 03:39:55 +10:00
axel
58fd6b895a Minor error handling improvements and minor code polish
darcs-hash:20070801173801-ac50b-11a281d9f622e935c1f138355babd20269068f35.gz
2007-08-02 03:38:01 +10:00
axel
df55e89bbb Spelling fixes from Chris Rebert
darcs-hash:20070801173524-ac50b-760d9ddf0e68aa24cd570b542824a7f2b3248ff5.gz
2007-08-02 03:35:24 +10:00
axel
91de143003 Replace the count function with a builtin for performance reasons. The count function used at least two forks, which was noticable on systems such as OS X with slow forks
darcs-hash:20070731212332-ac50b-8f5b2e70008ddb131dc8bae3f361d8d65a294948.gz
2007-08-01 07:23:32 +10:00
axel
748d726ddf Replace the count function with a builtin for performance reasons. The count function used at least two forks, which was noticable on systems such as OS X with slow forks
darcs-hash:20070731212320-ac50b-3bae489646f359ca86bb1f049901860ce9aedd5f.gz
2007-08-01 07:23:20 +10:00
axel
2caaa7526d Make sure completion descriptions generated by make_vcs_completions.fish are properly escaped. Thanks to Claes Næstén for the bug report.
darcs-hash:20070605105111-ac50b-e2cbb17047be6c6b0ddf5847507986f50c97be4c.gz
2007-06-05 20:51:11 +10:00
axel
778aa1c304 Print 'unknown' if 'mimedb -d' fails
darcs-hash:20070524171053-ac50b-c9374e0da7f4cf1458a19d9234e4752ae156e37e.gz
2007-05-25 03:10:53 +10:00
axel
c40eb8a716 Update regexps in mimedb to work on NetBSD. (NetBSD does not support having empty subexpressions. This bug was reported and diagnosed by Claes Nästén.
darcs-hash:20070524063728-ac50b-9377f6d2ba709e997c00d716e766a912cc1ee23e.gz
2007-05-24 16:37:28 +10:00
axel
1c6236831c Fix character set conversions in both directions in universal variable code. This fixes encoding issues on NetBSD. This patch was written by Claes Nästén.
darcs-hash:20070515194610-ac50b-9da1b06c8235dd94ae26074f2a42809d5b856743.gz
2007-05-16 05:46:10 +10:00
axel
c1b4fa847f Improved error reporting in mimedb for failed regexps. This patch was written by Claes Nästén.
darcs-hash:20070515193751-ac50b-8221971ea524cddaba3e8e72a61b151b399ea7b6.gz
2007-05-16 05:37:51 +10:00
axel
a6644631d9 Show hints on how to proceed if xsel fails to build
darcs-hash:20070510192411-ac50b-ec68699d6ca6ba2b315e5f283e30dfba4bad75b4.gz
2007-05-11 05:24:11 +10:00
axel
e4f5bc69e2 Make sure that the PWD and HOME variables are always in canonical form
darcs-hash:20070510191128-ac50b-dd51a75617d62e4f403094ddc7527a82c5de3103.gz
2007-05-11 05:11:28 +10:00
axel
03f322c715 Use ucs4 or ucs2 as a fallback character set if wchar_t encoding is not supported by iconv
darcs-hash:20070510061428-ac50b-ae9bfda1cc24bc29c2c492f902854440da319bfc.gz
2007-05-10 16:14:28 +10:00
axel
a72d877752 Add missing -b switch for the commandline builtin. This issue was reported by philip ganchev
darcs-hash:20070427223131-ac50b-f7a40d4cf7622cbce4b9d73cc2bc5e2d27ce386f.gz
2007-04-28 08:31:31 +10:00
axel
d0585befb3 Make sure that io redirections are respected by the '.' builtin. This was not the case earlier, which caused various bugs, especially after eval was made into a function that internally used '.'
darcs-hash:20070425183002-ac50b-d7d93e3b74e7274fe3e0aad98e95dd608bb903ae.gz
2007-04-26 04:30:02 +10:00
axel
784c5d9fa3 Update todo list
darcs-hash:20070424205314-ac50b-2b1048b8a50fd21fd264eba5b00647f3bdf23304.gz
2007-04-25 06:53:14 +10:00
axel
52e7a7ec1c Actually add the count function. Thanks to Tassilo Horn for the report.
darcs-hash:20070424153317-ac50b-f6ab71ad0ea9d74351169d18f1dc856a442ee3f4.gz
2007-04-25 01:33:17 +10:00
axel
c00e1fcf26 Fix bug in stack trace printing code
darcs-hash:20070424060620-ac50b-174e68e78bc2b1d6e5e3f5787e4a252cad95911c.gz
2007-04-24 16:06:20 +10:00
axel
5425970706 Add a fes minor completion corrections
darcs-hash:20070423220148-ac50b-460b1d404dca7169054459ab6c7f9845dad51a05.gz
2007-04-24 08:01:48 +10:00
axel
419b3166c8 Implement count as ashellscript function instead of a command in order to support very long argument lists. Note that this implementation is painfully slow for more than 1000 arguments.
darcs-hash:20070423220026-ac50b-69c4b06c88e6120429b6358f1b61f6076d392ce5.gz
2007-04-24 08:00:26 +10:00
axel
e2714b05eb Launch debug shell on TRAP signal.
darcs-hash:20070423211026-ac50b-fccf4fb588775fbacc5cdc9f121abe417970066f.gz
2007-04-24 07:10:26 +10:00
axel
2c02b59703 Replace the eval builtin with a function
darcs-hash:20070422221806-ac50b-28cffc6c3063c14cd8ab30f999e3530314c78af2.gz
2007-04-23 08:18:06 +10:00
axel
ee94424b0f Add the possibility for functions which do not shadow the arguments of the calling function
darcs-hash:20070422221033-ac50b-d9544c87d0ddab10f7f503b5a1707292f266efe4.gz
2007-04-23 08:10:33 +10:00
axel
2b7535bb51 Make the . (source) builtin able to read commands from stdin
darcs-hash:20070422211947-ac50b-b8d33d81fcef5e0b7e76a8d2a9f0bcbcf3ac67b7.gz
2007-04-23 07:19:47 +10:00
axel
c5805cfd47 Validate variables names when using named arguments for functions
darcs-hash:20070422211624-ac50b-11920a8a00c7bae97c3556bc7ce47b3022c34f08.gz
2007-04-23 07:16:24 +10:00
axel
7ca76ef743 Make 'functions' builtin print named arguments of functions
darcs-hash:20070422211534-ac50b-3293f1d733a8a3be760f344598bfae8b77647b2f.gz
2007-04-23 07:15:34 +10:00
axel
2c743173d3 Fix minor memory leak on printing help for builtins
darcs-hash:20070422211451-ac50b-42293b46e39cd5d0cfdf2ca63effe12faa048970.gz
2007-04-23 07:14:51 +10:00
axel
003dfb99da Prettyfy output of 'functions' builtin a tiny bit
darcs-hash:20070422185627-ac50b-99b7c27d06f5a6d5e7a7b66da864317bf1019fe2.gz
2007-04-23 04:56:27 +10:00
axel
dd48de068d Add funced function, which works like vared, but with functions
darcs-hash:20070422185539-ac50b-9080fb745cec45609e7e29971b55b96e073806e6.gz
2007-04-23 04:55:39 +10:00
axel
cb179c448b Minor tweaks to the indent program
darcs-hash:20070422185429-ac50b-f054a56d16ba55d2bbbd1d61e8bbfcb6c17a23a9.gz
2007-04-23 04:54:29 +10:00
axel
c323fc226f Add support for changing token separator in command substitution. IT is not the first character of IFS, same as in various other shells
darcs-hash:20070422184956-ac50b-7e03b375feb9fd22e11aa7a7d8f8add8e3b717a5.gz
2007-04-23 04:49:56 +10:00
axel
176c1a487b Minor improvements to the completion generator and gcc completions
darcs-hash:20070422101414-ac50b-07612cd287d524a361e358369732c26fc9ff3b67.gz
2007-04-22 20:14:14 +10:00
axel
2872df66d7 Add source code prettyfier program called fish_indent
darcs-hash:20070422100312-ac50b-a073999b7dc172259c8200f3e740c921647222a0.gz
2007-04-22 20:03:12 +10:00
axel
45412f2b1f Move keyword detection code to separate file
darcs-hash:20070422095026-ac50b-77a840e2830370f46b7a48fd8863095d2cd7a5f0.gz
2007-04-22 19:50:26 +10:00
axel
e9790db64a Fix bug in parser, on incomplete blocks. This bug was handled correctly by the error handler, so it was non-critical.
darcs-hash:20070422094847-ac50b-f8aff4c2939725e256b2f6d020f98240d2658d50.gz
2007-04-22 19:48:47 +10:00
axel
8ab1d0254c Add missing help building dependency
darcs-hash:20070421081244-ac50b-e78d648a50ec2ec48ef6bf95f5540e3c1a684633.gz
2007-04-21 18:12:44 +10:00
axel
4c858a10c9 Minor code edits (comments, function rename)
darcs-hash:20070421081122-ac50b-fdd497a6ff8a1d2507509f21a168c9130ed59ad7.gz
2007-04-21 18:11:22 +10:00
axel
b4ccce2dc3 Add completion support for named function arguments
darcs-hash:20070421080931-ac50b-c3e482ad145c619d23cc5f19256010b5b0697c57.gz
2007-04-21 18:09:31 +10:00
axel
06688fb9ea Change output format of complete -C to make writing case insensitive command specific completions more transparent
darcs-hash:20070420195506-ac50b-b5f56bb2964e65d13abfb9281ce26db2b8c341b7.gz
2007-04-21 05:55:06 +10:00
axel
4d5c50cbb3 Fix minor bug - the description would occasionally get appended to command specific tab completions in case insensitive mode
darcs-hash:20070420193430-ac50b-13e34ac41cf1662a74f0af329fb41d872df5d691.gz
2007-04-21 05:34:30 +10:00
axel
91d1dee06b Add completions for evince
darcs-hash:20070418224801-ac50b-83713782420d5f820add93e47b57d2289f289b61.gz
2007-04-19 08:48:01 +10:00
axel
3e030bc6c6 Add a completion function for completiong file url:s
darcs-hash:20070418224611-ac50b-4e457b2218751a182989f3635bb98c5e8a8b9766.gz
2007-04-19 08:46:11 +10:00
axel
b9009eba96 Remove explicit directory completion from __fish_complete_mime, we only want directory completion as a fallback in order to minimize the number of reasonable completions that are ignored. This issue was reported by Claes Nästén.
darcs-hash:20070417225658-ac50b-26178885ea4f8693858a74cec57a743831430634.gz
2007-04-18 08:56:58 +10:00
axel
90c5cea43d Fix URL character encoding bug in mimedb
darcs-hash:20070417062932-ac50b-7816e307ab180be02fc247f6c4796e7fa774862d.gz
2007-04-17 16:29:32 +10:00
axel
52f9560b4f Rename save_function to funcsave to keep consistency between function/variable functions
darcs-hash:20070416214453-ac50b-9ec9559fc468256dc149e92e9fece37da940ad7e.gz
2007-04-17 07:44:53 +10:00
axel
91ca8610ee Use cpp macro to avoid manually adding sentinel value to varargs functions
darcs-hash:20070416214041-ac50b-f682569c0d29ab3519bb59335debba525a640175.gz
2007-04-17 07:40:41 +10:00
axel
2efb88a30a Minor code cleanup in history search code
darcs-hash:20070416212615-ac50b-ca37865e50d0773abb5a4fdc7f71e5fa9a503c34.gz
2007-04-17 07:26:15 +10:00
axel
87223c68f4 Fix bug where case insensitive completions would miss the leading slash in file completions. This bug was reported by Claes Nästén.
darcs-hash:20070416210605-ac50b-eb1bc315ec360f8ccd5f37194c274796be97c607.gz
2007-04-17 07:06:05 +10:00
axel
5c9570eb56 Minor code tweaks
darcs-hash:20070416201053-ac50b-99d3ee51ef2b3642c737c3809bc2a4bfbe103b67.gz
2007-04-17 06:10:53 +10:00
axel
778b6a31ad Fix warning caused by bad casting
darcs-hash:20070416201034-ac50b-89a7257eadbf9098222cfb5ddc4bcf4bb88a8681.gz
2007-04-17 06:10:34 +10:00
axel
4d6751c274 Allow named arguments to function instead of only $argv. Philip Ganchev once suggested this, and it was suggested again by Egil Möller.
darcs-hash:20070416200611-ac50b-5eb42c94a65a4e72cae12cd9c04424bdc3b2b4f8.gz
2007-04-17 06:06:11 +10:00
axel
a03a4d1ba3 Add newline to error message in alias.fish. This problem was reported by flixil.
darcs-hash:20070412115221-ac50b-0ff23d6e2158522d10c7e799dc9f1594112f1869.gz
2007-04-12 21:52:21 +10:00
axel
5a670e2a96 Fix bug where fish would refuse to start if $HOME has an invalid value. Thanks to James Vega for the report.
darcs-hash:20070411131823-ac50b-2760c09e8939179a6c771a44220aa355381f4f0b.gz
2007-04-11 23:18:23 +10:00
axel
edf896f7cd Fix crash bug in recursive completion (e.g. 'which ls'). This bug was reported by Philip Ganchev
darcs-hash:20070326061307-ac50b-a89d4427b3f416f31e214bd833c4c76c6ebe3580.gz
2007-03-26 16:13:07 +10:00
axel
e128fa1a8e Fix a bug where io redirection of builtins would not truncate files if the builtin did not produce any output
darcs-hash:20070324223430-ac50b-3f3d6fd35f5b82c59ecaa06b459fe2b61dc8f387.gz
2007-03-25 08:34:30 +10:00
axel
e8ba091161 Move documentation on fish_prompt to the external command section
darcs-hash:20070324222135-ac50b-0b27258486492ea6178a852061dc894da60140ee.gz
2007-03-25 08:21:35 +10:00
axel
65d99117aa Minor code simplification in util.c
darcs-hash:20070324193801-ac50b-e45d88fd7de0204467a0f7d52b71ee323f4e3f0d.gz
2007-03-25 05:38:01 +10:00
axel
94a483d46b Minor tweak to vcs completion generation code. Most significantly, some svn command descriptions which where previously truncated are now complete.
darcs-hash:20070324193714-ac50b-61b10db649ef82ba8d8d658ef10cc05c2253d5f0.gz
2007-03-25 05:37:14 +10:00
axel
e750f1a3c2 Minor documentation fixes
darcs-hash:20070324191646-ac50b-0892de7e96348caf198830af2b2ad46b84f9f13e.gz
2007-03-25 05:16:46 +10:00
axel
3f4b47b4af Fix bug where case insensitive file completions would get directory components removed
darcs-hash:20070324190738-ac50b-2f94de910083eae1fe563284b9953071df706072.gz
2007-03-25 05:07:38 +10:00
axel
f6b3fcb4f5 Add missing sentinel value in function call - potential crash bug
darcs-hash:20070324190423-ac50b-e32dddfd98131c542133b98a8c49bc3d9c345fec.gz
2007-03-25 05:04:23 +10:00
axel
8fe90e4327 Include the make_vcs_completions.fish file that is used to generate various completiosn with the main tarball. Nick Pilon pointed out that it was missing. This patch also removes the make target for the file, which was used to chmod it, which is not needed since it is not used in the build chain.
darcs-hash:20070324115040-ac50b-d5b525be925d1a738b9ca6252c89e662a02a9e44.gz
2007-03-24 21:50:40 +10:00
axel
a17019e439 Do not flag a lone '-' as an error. Many commands accept it.
darcs-hash:20070324111455-ac50b-aaee0e9c80c3e57b1f0b5f421c80ed599d5c1e1b.gz
2007-03-24 21:14:55 +10:00
axel
b5baac8291 Try to fix the dependency problems with user_doc. Thanks to James Vega for investigating the cause of this.
darcs-hash:20070324110801-ac50b-ee833df5e34ae4fff8a4adb417647aadb8be9e29.gz
2007-03-24 21:08:01 +10:00
axel
f36508837b Use per-binary LDFLAGS to remove linking to useless libraries. This will reduce the size of the binaries and may also speed up startup time slightly. These changes are based on suggestions and a patch by James Vega.
darcs-hash:20070324105629-ac50b-64425ff68a18e3adf51eee141d3a4450405c1ddb.gz
2007-03-24 20:56:29 +10:00
axel
3969c1b453 Add a blacklist of console types that are known not to support terminal titles, even when in a virtual terminal
darcs-hash:20070317233846-ac50b-4030f863aefb96085368470b76ee9da146c04c96.gz
2007-03-18 09:38:46 +10:00
axel
1e524fbc7a Fix occasional shoowing of the same completion twice. Than ks to Tassilo Horn for the bug report.
darcs-hash:20070317231623-ac50b-a9447aa60d0ca654713a5391a3f6137d29d98916.gz
2007-03-18 09:16:23 +10:00
axel
3e1b0e587e Fix performance bug in command description lookup - it was performed once for every element in PATH. Thanks to Tassilo Horn for the bug report.
darcs-hash:20070317225611-ac50b-5df5227ddd88747781c981ed34a80844391573d1.gz
2007-03-18 08:56:11 +10:00
axel
2aea1d5a84 Initial checkin of code for using case insensitive completion as a fallback for regular completion. Some types of completions don't yet support the feature.
darcs-hash:20070228214327-ac50b-9b5c69a1c3e0c11b560f8c61be0441d2ee9d6404.gz
2007-03-01 07:43:27 +10:00
axel
6616543991 Add breakpoint builtin
darcs-hash:20061111105400-ac50b-18b9165f8719efd45b46e3b3786f7079edd721e7.gz
2006-11-11 20:54:00 +10:00
axel
83a3706099 Various minor codee updates. Dead code removal, comment tweaking. Spelling fixes, etc.
darcs-hash:20070225111738-ac50b-9656f807d2e41ebb06a43e10925834420740e20d.gz
2007-02-25 21:17:38 +10:00
axel
7c96cb2ff8 Second round of bug fixes and minor code improvements after the completions struct update. Fix space insertion issues on command specific completions.
darcs-hash:20070225103715-ac50b-5aaaa1c1c6ed1084ba68841fb70cc23c84f19806.gz
2007-02-25 20:37:15 +10:00
axel
a3c5718eb9 Round of bug fixes and minor code improvements after the completions struct update. Moves the file description code to wildcard.c, where it was actually used. Simplifies the memory allocations in that code significantly. Makes sure directoriy names don't get a space inserted after the completion.
darcs-hash:20070225090524-ac50b-4d095bf8da7c788a7828e707556edbdc0bbf5000.gz
2007-02-25 19:05:24 +10:00
axel
9b10fa4762 Make halloc-based list allocation work without context
darcs-hash:20070224131932-ac50b-4523781b1e3cc49e7cd7e3b2e1f21e28b1c5503f.gz
2007-02-24 23:19:32 +10:00
axel
0f51d5ec18 Do not use makefile to generate vcs completions, do it directly in the script. Also add some minor updates to the vcs completions.
darcs-hash:20070224125927-ac50b-f1242b198ea0651c993b045d584262dc32062338.gz
2007-02-24 22:59:27 +10:00
axel
73a67c2a43 Fifth phase of using a real struct for passing around completions - make expand.c and wildcard.c use the struct internally. This makes all completion code use the new struct.
darcs-hash:20070224081131-ac50b-aba4ff255c6dc1ce9ad375d6cd1acde919c7cbd6.gz
2007-02-24 18:11:31 +10:00
axel
6859e012d9 Fourth phase of using a real struct for passing around completions - make expand_string return a completion_t struct. Also make the reader sort and remove duplicates again
darcs-hash:20070218232520-ac50b-e23339ec5bba673681eced110e1b0b344eb5d976.gz
2007-02-19 09:25:20 +10:00
axel
680cf17570 Third phase of using a real struct for passing around completions - make all of complete.c use the completion_t struct
darcs-hash:20070218120841-ac50b-ae97122e9c9922271e93f9b7dd8808072820e873.gz
2007-02-18 22:08:41 +10:00
axel
854c4aee9a Second phase of using a real struct for passing around completions - make variable, user and command completion use the completion_t struct
darcs-hash:20070217110555-ac50b-8f08ade57885bc2ee17a07f5e789368e7dad9421.gz
2007-02-17 21:05:55 +10:00
axel
104ec963c2 First phase of using a real struct for passing around completions - only use it on things returned by complete(), e.g. use it in the reader
darcs-hash:20070209093350-ac50b-d91fe87be4612a56bff2139349cefa28a504cbb7.gz
2007-02-09 19:33:50 +10:00
axel
08eb92707a Fix paran mismatch bug in umount completions that popped up when dropping the N_ script
darcs-hash:20070223163630-ac50b-efa267645ce113eab089d49d240bb3e00e9f07e5.gz
2007-02-24 02:36:30 +10:00
axel
e50f43416b Add missing file for vi completions that is needed to complete files selectively based on mime types. Also use it to improve emacs completions, in order to balance my GNU karma.
darcs-hash:20070222214555-ac50b-60aa6a3e4cea77451c51d40d2a574d145f3de4fe.gz
2007-02-23 07:45:55 +10:00
axel
58755fc579 Do not make documentation generation depend on Makefile
darcs-hash:20070216200015-ac50b-981a883d95acd776e1e58d6ca74f95b5494fd305.gz
2007-02-17 06:00:15 +10:00
axel
31ca1218d4 Fix bug where fish would randomly assume completions are authorative
darcs-hash:20070209093237-ac50b-d6ccbddf652a8307c8fd43406fc0ad059a2ba834.gz
2007-02-09 19:32:37 +10:00
axel
44e8a12b66 Update darcs completions with additional command specific completion for setpref subcommand
darcs-hash:20070208172759-ac50b-2a233f8590dbb13a47ff243efa351dc6bce8f47a.gz
2007-02-09 03:27:59 +10:00
axel
fe21577a8e MArk make_mercurial_completions.fish as executable
darcs-hash:20070208172658-ac50b-c721b6a07934d11e8467dad78a2fbb206f0b24cd.gz
2007-02-09 03:26:58 +10:00
axel
a4ac924512 Bump version number
darcs-hash:20070208170725-ac50b-083a3c094fc4901b949cd71e7ff956f6dae958c4.gz
2007-02-09 03:07:25 +10:00
axel
e936629dc3 Minor documentation update to reflect change in how __fish_complete_suffix function works
darcs-hash:20070208170339-ac50b-3ce23bc61e8cd7c4874748dd5f1395739c57ad36.gz
2007-02-09 03:03:39 +10:00
axel
dfabf7f206 Update todo list
darcs-hash:20070208170232-ac50b-7413e8283f40a38c9790b391a70954897ae0bcae.gz
2007-02-09 03:02:32 +10:00
axel
7118269e4b Minor tweaks to vared function
darcs-hash:20070208170118-ac50b-76ea318d47de28a4437ecf0a50daea2c617017ea.gz
2007-02-09 03:01:18 +10:00
axel
100355c3c1 Add chengelog entry to spec file for fish
darcs-hash:20070208170032-ac50b-d748dc073ffb6ea0e209d0d99bd3dcc6eba2f2cd.gz
2007-02-09 03:00:32 +10:00
axel
4b1fced1f8 Add -u flag to case completions - case is often used to parse switches, coloring them red makes no sense
darcs-hash:20070205122839-ac50b-a87b86846216ad495f58825f3cb27692fc8bf269.gz
2007-02-05 22:28:39 +10:00
axel
abff4e5b41 Add flags for long file support in configure.ac. They should be useful when supported (e.g. Linux and Solaris) and should do no harm when unsupported.
darcs-hash:20070205122553-ac50b-93adeeafc5c4bb43397e4b088f6e9de5744b3058.gz
2007-02-05 22:25:53 +10:00
axel
25082b6528 Update vi/vim completions. Add __fish_complete_text function that completes using any text file, and __fish_filter_mime that filters a file list based on mimetype. This update was written by Velko Hristov with some suggestions and updates by me.
darcs-hash:20070204151809-ac50b-b7f3b44ac528f9e994bf0f842ee2e008866fb620.gz
2007-02-05 01:18:09 +10:00
axel
766482d90e Fix bug in read builtin - signal handlers where not correctly set, causiong ^C not to work
darcs-hash:20070201002053-ac50b-b73e22cbeecaeb364974cd2c512efbd517bb90d3.gz
2007-02-01 10:20:53 +10:00
axel
15e0a44fc7 Fix bug where pressing ^C while in the read builtin would mess up the block execution bit
darcs-hash:20070131235810-ac50b-23dde9d0e13cc028b744307073c1daf989258b54.gz
2007-02-01 09:58:10 +10:00
axel
3b653cd26a Fix indentation error - the else builtin was not properly indented
darcs-hash:20070131231820-ac50b-1c5825cd78a1636801b8a4a26c1d15eb811cb28f.gz
2007-02-01 09:18:20 +10:00
axel
ba6661e9df Fix occasional duplicate stack trace, reported by Mike Roberts. Also make fish less likely to print huge amounts of help in non-interactive mode, as per suggestion from Mike Roberts.
darcs-hash:20070131160317-ac50b-8354948f55a1478515ebfe7ddb6db14b6775dd18.gz
2007-02-01 02:03:17 +10:00
axel
55af8e4966 Add support for checking the existance of specific variable array elements
darcs-hash:20070130204344-ac50b-d006de7693722677d052f7559923753acd27a4a2.gz
2007-01-31 06:43:44 +10:00
axel
dcad2ef17b Switch various completions to the simpler format for __fish_complete_suffix
darcs-hash:20070130153435-ac50b-abe42f3f464cb96db062c83084d97ef377a72e80.gz
2007-01-31 01:34:35 +10:00
axel
418192b312 Make the first and last argument to __fish_complete_suffix optional. Use mimedb to look up descriptions if not supplied.
darcs-hash:20070130152631-ac50b-24f1c947d88ce3ad20f31a17b58adfe02cf002e2.gz
2007-01-31 01:26:31 +10:00
axel
76d9051605 Add vim completions, written by Velko Hristov
darcs-hash:20070130004233-ac50b-5c48b940b29ac4f3c377bc88e2abf2e490e9df48.gz
2007-01-30 10:42:33 +10:00
axel
ca2b2103d3 Add command specific completions for xterm, written by Velko Hristov
darcs-hash:20070130000155-ac50b-7834a733d6bc48f3b57172fa6dc49c36680d575d.gz
2007-01-30 10:01:55 +10:00
axel
14e6bdb139 Add command specific completions for totem, written by Velko Hristov
darcs-hash:20070130000128-ac50b-8aec9bbe3858d03189720ed6fc9906ce8f9d4ddc.gz
2007-01-30 10:01:28 +10:00
axel
20d42378de Remove trailing period in descriptions for darcs and svn
darcs-hash:20070129183116-ac50b-c4870570baaee554457413360c084209cb6a4090.gz
2007-01-30 04:31:16 +10:00
axel
41c9f89fcf Add memory allocation check
darcs-hash:20070129175223-ac50b-05b933837cf0522889287069d5ed2fcacaf62b6a.gz
2007-01-30 03:52:23 +10:00
axel
7953863b38 Fix bug where quiting from the read builtin could cause the prompt not to repaint
darcs-hash:20070129174501-ac50b-7e7f62ab8a1864617291208919551505bae6e156.gz
2007-01-30 03:45:01 +10:00
axel
3fff030ee2 When clearing a line in the screen handler, also make sure that the internal state reflects this. This helps avoid issues with wiping out parts of the prompt
darcs-hash:20070129174358-ac50b-73d002a44ef53ba63e33c66073eea6fec449b9d0.gz
2007-01-30 03:43:58 +10:00
axel
da9f7227f5 Fix repaint bug for read - screen needed repainting after call to read
darcs-hash:20070129162807-ac50b-c037ecfc0670a1f2795982337760f76036d6cdc5.gz
2007-01-30 02:28:07 +10:00
axel
ba932b6590 Add support for -s switch to read builtin, enables shell syntax highlighting in the read builtin
darcs-hash:20070129162624-ac50b-dff9d9ebf16ce3247b83d917efbffd4942cda83f.gz
2007-01-30 02:26:24 +10:00
axel
c02e2b1320 Empty environemnt variable array entrys are now set to the empty string - what value should they really have?
darcs-hash:20070128134331-ac50b-a1efdcd67e1d142c5f234a4018187fdb2f70b567.gz
2007-01-28 23:43:31 +10:00
axel
37a95a3096 Make parsing of --authorative switch for complete builtin more logical. Fix bug with previous approach causing some completions to be ignored.
darcs-hash:20070128134059-ac50b-de53eb223939fbdf0d247dfbe343c62fc31cce11.gz
2007-01-28 23:40:59 +10:00
axel
bbd229b206 Add command specific completions for file and locate, written by Velko Hristov
darcs-hash:20070128114415-ac50b-f5844d6523a9aed3ca0e881c6c125072caee4978.gz
2007-01-28 21:44:15 +10:00
axel
6a60377e02 Add -u switch to completions which can have unknown switches or which are incomplete
darcs-hash:20070128032652-ac50b-dae70e7b2efddbc757aae8bc7d1884ff5e010621.gz
2007-01-28 13:26:52 +10:00
axel
fc87b3c4b4 Make it possible to specify the -u switch tom complete without actually specifying any new completions, since it affects all previous completions
darcs-hash:20070128032416-ac50b-93b943d712ac072f1bdb7f568e8064f73ffb85e0.gz
2007-01-28 13:24:16 +10:00
axel
fcbdb6f2a7 Add command specific completions for mutt and sylpheed, written by Velko Hristov
darcs-hash:20070128024639-ac50b-484668bdfb13c4cd23e058224d14b8f6d52b04d0.gz
2007-01-28 12:46:39 +10:00
axel
a537b01814 Add aptitude completions, written by Velko Hristov.
darcs-hash:20070127231612-ac50b-0a3b6ef52a01b5b15b0b1a9f11df739d02fa353c.gz
2007-01-28 09:16:12 +10:00
axel
bd5a16d213 Add support for using __environ instead of environ, if it exists and environ isn't set
darcs-hash:20070127165911-ac50b-72747760d767a6918152c2e4f254febb19ab1205.gz
2007-01-28 02:59:11 +10:00
axel
be0bd50bad Remove unneeded code from isatty, fix spelling in docs
darcs-hash:20070127141215-ac50b-d15c657b62862841df80c55095a05e9c38086a11.gz
2007-01-28 00:12:15 +10:00
axel
cab5c63402 Verify that fd redirection is an int
darcs-hash:20070127135010-ac50b-d9c048edc5579c460ed2b181c366c67e9cfd7beb.gz
2007-01-27 23:50:10 +10:00
axel
d480d892c9 Do not call getc if getwc fails - mixing wide and byte-based readin may cause a crash. IT's better to simply hope that getwc can recover.
darcs-hash:20070127021026-ac50b-b85e10029d2bc0ce4857ec48945a92270e499a07.gz
2007-01-27 12:10:26 +10:00
axel
f2ccbe7374 Make get_desc_buff variable functions local static instead of global
darcs-hash:20070127020924-ac50b-0dfd72f6c30a82adc9500020df4b7bafb8d6dd56.gz
2007-01-27 12:09:24 +10:00
axel
85241817f8 Drop unneeded generic descriptions for completion of functions and builtins. Add description for count.
darcs-hash:20070127020752-ac50b-62dba47967cac04cd242894bfaa03116461883f3.gz
2007-01-27 12:07:52 +10:00
axel
8cf46bdb5c Add make target for vuilding svn and cvs completions
darcs-hash:20070127020406-ac50b-a5dee791cf05cf76dd23395deee5e2d9f347c71b.gz
2007-01-27 12:04:06 +10:00
axel
5e6d1efb56 Fix a few more trailing N_ calls
darcs-hash:20070127020240-ac50b-6081d8cc0bc5d648b53b3ddfe878ec0f65412b6e.gz
2007-01-27 12:02:40 +10:00
axel
bc1f9b6f1c Another batch of fixes for the VCS completions
darcs-hash:20070127020141-ac50b-e617fbabb234af668fa7ded7f838d66477605c8d.gz
2007-01-27 12:01:41 +10:00
axel
85d069c106 Fix crash in tab completion code when completing an imcomplete backsalsh escape
darcs-hash:20070126171413-ac50b-a9338dc73863381f2b22e09fb8b5e711f64b8f29.gz
2007-01-27 03:14:13 +10:00
axel
cfecb58bb6 Fix various completions that didno't drop the N_ no-op
darcs-hash:20070126012631-ac50b-4e13c06ddbf73f05a0a26824c71dbb96aa7ce0b9.gz
2007-01-26 11:26:31 +10:00
axel
11c2ec91d4 Update make_mercurial_completions.fish to also handle cvs. Correct bug causing issues in darcs completions.
darcs-hash:20070126012321-ac50b-caa9749f5e844ce5d06d84f2c38e282049369ed1.gz
2007-01-26 11:23:21 +10:00
axel
cc6f133368 make the make_mercurial_completions.fish script able to handle svn as well. Update svn completions.
darcs-hash:20070125153452-ac50b-60dce711d8614f99ba24ab9b24acfbd879d58bfa.gz
2007-01-26 01:34:52 +10:00
axel
350b637a1a Generalize make_mercurial_completions.fish a bit so it can be used with darcs as well. Add make targets for creating darcs/hg completions.
darcs-hash:20070125132836-ac50b-0e7a728e4be2386d696094a414a1c8bcaee771fc.gz
2007-01-25 23:28:36 +10:00
axel
f917dccf6f Use make_completions.py to make new completions for gcc
darcs-hash:20070125012757-ac50b-21408f89b71abb894850ddff452c83d130ed0401.gz
2007-01-25 11:27:57 +10:00
axel
62d380a1ee Make first stab at a manual page parser. It takes the name of a command as input and outputs completions for it.
darcs-hash:20070125012728-ac50b-442dec7a0252f7cf817f442623161e33ce50c355.gz
2007-01-25 11:27:28 +10:00
axel
65ef6cf217 Add completions for hg (Mercurial). These completions are autogenerated from the help commands for mercurial through the make_mercurial_completions.fish script
darcs-hash:20070124225136-ac50b-1636989747df4e2510905e3286dbf1871522f653.gz
2007-01-25 08:51:36 +10:00
axel
2bba0f7b8f Use MB_LEN_MAX instead of MB_CUR_MAX as the length of an array, since the latter does not need to be a constant value, meaning it is illegal as an array size
darcs-hash:20070122165125-ac50b-884456df993125e0dc16cd8dfed1e63d350d05dd.gz
2007-01-23 02:51:25 +10:00
axel
565970b8ca Fix uninitialized varialble in env.c
darcs-hash:20070122012815-ac50b-a04cfc343ce75afd4feff8e25c580f9e54d5c5ef.gz
2007-01-22 11:28:15 +10:00
axel
6ea3dd7dfe Minor edit to init scripts to reduce number of non-builtins called on init
darcs-hash:20070121155057-ac50b-1fae99ef89abc7bc08dc31eb671bfc556e34202d.gz
2007-01-22 01:50:57 +10:00
axel
8176a1253b Do not use stdout to report errors when stderr is dead - take the hint instead...
darcs-hash:20070121152242-ac50b-3e192328959cf65f03756b3bfbb794fb43dccead.gz
2007-01-22 01:22:42 +10:00
axel
4f67c38777 Use constant instead of hardcoded value for sleeptime on failed fork call
darcs-hash:20070121152026-ac50b-1daaac921f31dd10b2646d51b65af5260890d291.gz
2007-01-22 01:20:26 +10:00
axel
86beb7b109 Minor code simplification in exec.c
darcs-hash:20070121151943-ac50b-d913d1b205443cdf40a83a1d001e4d7a114c6e0c.gz
2007-01-22 01:19:43 +10:00
axel
98a6c491b1 Print stack trace when execting due to fatal problem or bug
darcs-hash:20070121150341-ac50b-66b86014963568bf402a76d5beb7c1d4e188c5f7.gz
2007-01-22 01:03:41 +10:00
axel
66c045c439 Minor code edits. Add curly brackets in various places, add or rewrite various comments, fix indentation, etc.
darcs-hash:20070121150114-ac50b-4fd6965cb2c557178923f8afa944835166e08423.gz
2007-01-22 01:01:14 +10:00
axel
a1ec38f53b Check error code when writing output from builtins - try to report errors
darcs-hash:20070121145810-ac50b-46ecb601ce9f0d862f00e4a97f25b6034e52f4cc.gz
2007-01-22 00:58:10 +10:00
axel
64f1024eb5 Make all error messages from options parsin in builtins redirectable
darcs-hash:20070121145527-ac50b-1375af219a5eba6167e99d3fe24b26dba60eba2a.gz
2007-01-22 00:55:27 +10:00
axel
b3500bfbdc Fix bug in rsync completions
darcs-hash:20070121024539-ac50b-6bef9090303c56d117633077554bb43c40f64024.gz
2007-01-21 12:45:39 +10:00
axel
f8c45324b6 Add switch completions for the rsync command
darcs-hash:20070121023815-ac50b-178776e2fe6c3d510f4f1342269c132797a7793a.gz
2007-01-21 12:38:15 +10:00
axel
bf5d4f6b07 Simplify completions for a few commands (svn, cvs, darcs, yum)
darcs-hash:20070120170940-ac50b-24c0e5b05ca03a590b90e795bbd62b15583e2bd1.gz
2007-01-21 03:09:40 +10:00
axel
1300e68fa5 Add support for backtraces - if the compiler and libc version supports it (probably only glibc/gcc) then a stack trace is printed on serious bugs
darcs-hash:20070120023649-ac50b-5efa310bea0deddfa1d8dfca1000163eee89c7cb.gz
2007-01-20 12:36:49 +10:00
axel
1a76f2ecb9 Do not purge internal history if saving history to file fails
darcs-hash:20070120023347-ac50b-8e61c5f65cfca3ffdb6dd740fc32b91a975fdb87.gz
2007-01-20 12:33:47 +10:00
axel
9c5fb0392d Make save_function print the help text when given no argumetns. Thanks to Alexander Kellett for the suggestion.
darcs-hash:20070119131538-ac50b-a77f60f557677543f38c73ffc21a209432b8b26a.gz
2007-01-19 23:15:38 +10:00
axel
f4c5eaf05b Spelling fixes in documentation
darcs-hash:20070118173337-ac50b-4bfe34ea056f6fbc007df4c0b97cde695c822923.gz
2007-01-19 03:33:37 +10:00
axel
dd90b4ece4 Fix incorrect use of the term 'alias' where 'function' was meant in documentation
darcs-hash:20070118170034-ac50b-f10d79a1aed0e91d350db13187965bf2f5c45b7e.gz
2007-01-19 03:00:34 +10:00
axel
4930db35e2 Correctly unescape tokens when performing switch completion
darcs-hash:20070118164528-ac50b-fcaa59d247c4c6b430ab47b293d5eb173a97e9fc.gz
2007-01-19 02:45:28 +10:00
axel
e6409a88d5 Add missing completion for the commandline builtin
darcs-hash:20070118163104-ac50b-e33d3888efa42218881291ce1d2636ca14f10805.gz
2007-01-19 02:31:04 +10:00
axel
77a48dc252 Minor performance improvement in the variable assignment code
darcs-hash:20070118162922-ac50b-0f4bfd125e20673fdcb928e2a7aac6af50a1dec7.gz
2007-01-19 02:29:22 +10:00
axel
029be823e2 Remove the final non-builtin call from __fish_gnu_complete, to make it even faster
darcs-hash:20070118162853-ac50b-a31f51d53ba3121eaf6dfb4006dde00491fd53c2.gz
2007-01-19 02:28:53 +10:00
axel
421aff7d67 Make command specific completions handle quoted and otherwise escaped tokens better by making sure that the output from the commandline builtin is properly unescaped
darcs-hash:20070118162700-ac50b-cd93d9a6aff5bb7629a790d60b241000eb1d0ac0.gz
2007-01-19 02:27:00 +10:00
axel
9e7094adfc Fix bug in code for unescapiong strings - when not in unescape_special mode, quotes would not get properly removed. This patch also adds the ability to check that quotes match up when unescaping. This functionality is on by default and can be disabled using a special flag.
darcs-hash:20070118160246-ac50b-b230c3fcd8440025b5243d76de2a9fd400f7ea32.gz
2007-01-19 02:02:46 +10:00
axel
19e8d60179 Make 'fish --help' display a help message, not start the help browser
darcs-hash:20070117131246-ac50b-328c735ba09b8488cf6ee5b95d73290681ce5f06.gz
2007-01-17 23:12:46 +10:00
axel
9d9869e515 Documentation touchup. Give a few examples in the section about escapeing characters
darcs-hash:20070116164834-ac50b-dd4c23ae1b8e35bbb2d3e186c2a819d8f2647ec2.gz
2007-01-17 02:48:34 +10:00
axel
54e19b1efb Add a one-item cache into the hash table. This reduces the number of hash computations by roughly 20%
darcs-hash:20070116163707-ac50b-214a16d4210d32fb50693e71a14b6b8f3fededfe.gz
2007-01-17 02:37:07 +10:00
axel
f603b6ef68 Fix potential use of ininitialized variable. Could cause fish to save the history even when unneeded.
darcs-hash:20070116151130-ac50b-6186e6da834bae3ea07f3f25a105592f5115e0f3.gz
2007-01-17 01:11:30 +10:00
axel
81e0fcbc13 Additional performance tweak for __fish_gnu_complete
darcs-hash:20070116125116-ac50b-0a702bc02f9a126b36505864dcc597661a7ca2b0.gz
2007-01-16 22:51:16 +10:00
axel
b999bd9c8c Bugfix in __fish_gnu_complete - switches could be ignored
darcs-hash:20070116112226-ac50b-6d6ce88d87f74a3779e4c6de6c62068c49354966.gz
2007-01-16 21:22:26 +10:00
axel
9c9a8f9d0f Improve speed of __fish_gnu_complete on systems with no native seq implementation by avoiding using seq at all
darcs-hash:20070116102651-ac50b-ad7e0acd325f88d1676e4c533bc863caedf91748.gz
2007-01-16 20:26:51 +10:00
axel
461ef2a508 Fix completion bug where fish would refuse to provide completion strings for '--'
darcs-hash:20070116015938-ac50b-353566d9fd8984cabd56127a9088d57695e2b7ba.gz
2007-01-16 11:59:38 +10:00
axel
7492b6cdb3 Make all descriptions for function calls use the implicit translation from the previous patch instead of explicitly using N_
darcs-hash:20070116012918-ac50b-c1c0df64333ad910ca81dbc86ad193ece6680722.gz
2007-01-16 11:29:18 +10:00
axel
34e27ff4c2 Drop use of the N_ no-op for translation descriptions. Instead, tell xgettext that any token following '--description' should be translated. This should greatly speed up completion loading on platforms where fork() is slow. (Hi, OS X)
darcs-hash:20070116011828-ac50b-fb923dc877869ded4d506bbe0bc5364eea44092f.gz
2007-01-16 11:18:28 +10:00
axel
47588c8e75 Darcs completions: Check for file existance before trying to complete using the repos file. Thanks to Alexander Kellett for the bug report.
darcs-hash:20070115205209-ac50b-60c03383f55bb2dc1d0f5317d907f71c63b2bb7b.gz
2007-01-16 06:52:09 +10:00
axel
00c6fcfe98 Document -f option for psub, add tab completions
darcs-hash:20070115181924-ac50b-6ac48aec8937e9dd172858dfa7eaaac1aca14775.gz
2007-01-16 04:19:24 +10:00
axel
c90f7c3203 Update todo list
darcs-hash:20070115175516-ac50b-8e5e316633ff0951b9165067b9b0e777753f5365.gz
2007-01-16 03:55:16 +10:00
axel
6467ead9ad Make sure read returns with a non-zero status if no string was actually given
darcs-hash:20070115175346-ac50b-9bbcfd114344f030c46456d2d603ce323406bfea.gz
2007-01-16 03:53:46 +10:00
axel
cb7caf2afc Minor edits - add a few input checks, remove a few commented pieces of debug code, add a few brackets, etc.
darcs-hash:20070115175144-ac50b-2045f2132156645222e6dde57487aa299a5316e2.gz
2007-01-16 03:51:44 +10:00
axel
c6ebb23f38 Add a -f switch to psub to use regular files instead of fifos. This makes psub work with programs that need to seek. This change was suggested by Alexander Kellet.
darcs-hash:20070115174330-ac50b-2349cef2d1a26a9e7c9356691bc74991135c1d2c.gz
2007-01-16 03:43:30 +10:00
axel
5753d63958 Check all file writes for errors when saving history file
darcs-hash:20070112161724-ac50b-21721102c5844ba871668093cb7428dc793d2ba6.gz
2007-01-13 02:17:24 +10:00
axel
e56d9765d7 Add missing completions to ulimit
darcs-hash:20070112152048-ac50b-b402f5e5fb9bfa0720b7b89de465d06bf66a1ac3.gz
2007-01-13 01:20:48 +10:00
axel
a5b7ec2624 Clarify documentation for the ulimit builtin
darcs-hash:20070112151540-ac50b-70ce1dbbad6b4e559723e1c5f8cf6fc3e271cf77.gz
2007-01-13 01:15:40 +10:00
axel
b2fa41307c Clean up the 'ulimit' builtin. There was a bug making it impossible to set the stack size, the switch '-p' was erroneously accepted, and the multiplier was not always correctly used, e.g. when reporting limits.
darcs-hash:20070112150017-ac50b-aff8db509f1bc8bb9803aa66bfad70ebc85d27b2.gz
2007-01-13 01:00:17 +10:00
axel
fce74c73c7 Minor code edits - show user name when completing home directories and minor code simplifications
darcs-hash:20070110173445-ac50b-40fd22ba766239dcfe6797155a852591b76f9253.gz
2007-01-11 03:34:45 +10:00
axel
e110b29c2f Do not complete using switches after a '--' has been encountered
darcs-hash:20070110124528-ac50b-111f01af0701f2fcc2bd22a7666b74497835356a.gz
2007-01-10 22:45:28 +10:00
axel
a3aba0269d Make it possible to cancel a long-winded wildcard match by pressing ^C
darcs-hash:20070109164705-ac50b-d8bf2c22e9ecb6bccec6892da266016dcae79a4c.gz
2007-01-10 02:47:05 +10:00
axel
e1f4aa5fcd Updates to the swedish translation
darcs-hash:20070109141310-ac50b-0fd8faccb396f0576917be3e4096701a2cdc3ca7.gz
2007-01-10 00:13:10 +10:00
axel
e19ee86b0d Update dependencies for making .po files in Makefile
darcs-hash:20070109134457-ac50b-31e9a1225e7deb5c097fb05c103bc5dc5bb58eea.gz
2007-01-09 23:44:57 +10:00
axel
6e71b5a59c A few more error checks during string to integer conversion in various places
darcs-hash:20070109134117-ac50b-8816e238b0b6aa3fe83c0a4695d719a60b0d17d4.gz
2007-01-09 23:41:17 +10:00
axel
b70092e281 Check for errors during string to integer conversion in various places
darcs-hash:20070109032005-ac50b-29514c9c8c19c70b7cfe7670a5c74899f316931f.gz
2007-01-09 13:20:05 +10:00
axel
602eac89c4 Fix typo in user message, remove a few warnings, minor indentation edits
darcs-hash:20070109025356-ac50b-328e42b8898bbc9b40b4841a032ae7871dba9e13.gz
2007-01-09 12:53:56 +10:00
axel
d8b5cc6717 Handle out of memory condition in various parts of fish by shutting down instead of crashing
darcs-hash:20070109025102-ac50b-ee7951028e626628257852fd9b5de97572609cea.gz
2007-01-09 12:51:02 +10:00
axel
76fedccf13 Make it possible to specify an error handler function for out of memory in any of the collection functions. Make the default oom handler print the line where things failed and exit.
darcs-hash:20070109013521-ac50b-dc7304cfb548cf1efc100124125eed032e392169.gz
2007-01-09 11:35:21 +10:00
axel
41206e70b4 Make the bg builtin check that all specified jobs exist before sending any of them to background. Also make sure that the string to pid conversion didn't throw errors.
darcs-hash:20070109002144-ac50b-c3954d98bab5cd95699966b2d1f2480797a9094d.gz
2007-01-09 10:21:44 +10:00
axel
bc2c37c739 Fix accidentally triggering of error condition when nothing bad happened in fish pager init code
darcs-hash:20070108230338-ac50b-c4d0a44ee06660acf107388f1c889296a535494b.gz
2007-01-09 09:03:38 +10:00
axel
4a2a47666f Fix indentation and add a few comments to fish_pager
darcs-hash:20070107164336-ac50b-d3cfa100a499d3f0996aac16288c4c892a65c1fe.gz
2007-01-08 02:43:36 +10:00
axel
94fbbb7669 Update todo list
darcs-hash:20070107142445-ac50b-391ff0eac6a84ae3dd5345d338682d243d40fb0a.gz
2007-01-08 00:24:45 +10:00
axel
63010c26ad Two very minor code touch ups
darcs-hash:20070107142430-ac50b-20cd4fe96c03c052bb6fb5c07ce207a534e86498.gz
2007-01-08 00:24:30 +10:00
axel
f398b2eafa Remove comments from apropos matching in function for getting description for command from whatis database
darcs-hash:20070107142000-ac50b-0221d36e24d3d68f0a25535e7a7b303e4fb84abe.gz
2007-01-08 00:20:00 +10:00
axel
1214067d03 Redo the interface between fish and the completion pager. The old interface has issues if the current user does not own the tty, as happens when using 'su'. It also had issues when stderr was redirected. The new interface should be more extensible as well.
darcs-hash:20070107141336-ac50b-30bdfb198674b93a67d323c0a65b8e08b43c0525.gz
2007-01-08 00:13:36 +10:00
axel
0469d05447 Make it possible to buffer input to other file descriptors than stdin. It is still only possible to buffer input on a single descriptor to any given job.
darcs-hash:20070107141052-ac50b-561265cd5acde7d882e4506870f13d61d34b3734.gz
2007-01-08 00:10:52 +10:00
axel
2fcec27e23 Make sure errno is not changed when error reporting after a failed call to execve
darcs-hash:20070107140918-ac50b-35186f2300d6ec03dbeac2cb5d5ffcee3feffc4e.gz
2007-01-08 00:09:18 +10:00
axel
42d0283489 Fix bug in IO redirection making is possible for the IO redirections to fail in cases where there are multiple pipes and buffers using file descriptors above 2.
darcs-hash:20070107140646-ac50b-dee4f380320ef2743635e77401a789c28d45f805.gz
2007-01-08 00:06:46 +10:00
axel
3fbd8036f4 Fix potential crash bug when pasting large amounts of text into the shell
darcs-hash:20070107140410-ac50b-c7b680b05f3aaf7f10e6e06a0fdc232d30c3e1b1.gz
2007-01-08 00:04:10 +10:00
axel
3b4bacb5ba Allow the user to specify name of history file to use with the read builtin
darcs-hash:20070106142430-ac50b-32ad52077e11438799b17911dc83e57f89e02f2b.gz
2007-01-07 00:24:30 +10:00
axel
7e350dab66 Update the dcop completions. This update was written by David Bitseff.
darcs-hash:20070106130722-ac50b-a73277cfccbf456595f0fb7ceeb18d23b2f744ab.gz
2007-01-06 23:07:22 +10:00
axel
9c23d50e92 Fix bug in completion pager where non-ascii characters where escaped because the locale was set after the completion strings where read in. Thanks to mikeX for the report.
darcs-hash:20070103125702-ac50b-752f6e1182dba4356e068191b52fdb05d3cb5649.gz
2007-01-03 22:57:02 +10:00
axel
2ec7428e32 Add iconv completions
darcs-hash:20061226142933-ac50b-dd385732a0337f215855db4c517dc1bab52b2aca.gz
2006-12-27 00:29:33 +10:00
Tassilo Horn
594f81ec8c svn-delete-completion.dpatch
darcs-hash:20061221212334-c06f4-2db8d07267b142165302d63fd94fdc0eb9f6f791.gz
2006-12-22 07:23:34 +10:00
axel
9767b76881 Fix minor type in 'find' completions
darcs-hash:20061219152443-ac50b-989d374683f181a5fc41d162f2a0793ca31227ac.gz
2006-12-20 01:24:43 +10:00
axel
0ace93c2a4 Fix yet another place where the 'builtin' builtin was used in stead of 'command'
darcs-hash:20061214182409-ac50b-60af38f1b1edcafcf1c0aff9c64094b92a84e5fc.gz
2006-12-15 04:24:09 +10:00
axel
c73d165165 Make the directory history keyboard shortcuts repaint the screen. Otherwise, the prompt won't reflect the new CWD. This is needed because of the reduced amounts of repainting done since 1.22.2
darcs-hash:20061214182313-ac50b-a912bcc0fac6e1d78f116e19f31f1c50ffc409cb.gz
2006-12-15 04:23:13 +10:00
axel
c1945f8275 Minor highlighting tweaks to make highlighter handle switches to 'command' and 'builtin' builtins more correctly
darcs-hash:20061214134025-ac50b-e17f79d1d4d7594ab20a358296f84dbb6356f42b.gz
2006-12-14 23:40:25 +10:00
axel
4d368dc06c Do not add --help completions for builtins at init time. These completions are already present in the commmand specific completions
darcs-hash:20061214131239-ac50b-3626c53c9c985bc3b786d5d6baff5e162a5e4951.gz
2006-12-14 23:12:39 +10:00
axel
9ff0e9cf72 Fix incorrect use of the 'builtin' builtin when the 'command' builtin was intended
darcs-hash:20061214120630-ac50b-5cee4b32042bb23c1a4b01e2a400a4af13c64c9c.gz
2006-12-14 22:06:30 +10:00
axel
a971d91a70 Make tab completion of process expansion consider other processes than those owned by the shell. Also makes tab completion of process expansion properly handle paths in command names
darcs-hash:20061214115811-ac50b-8569bcd30f97fe505dc1e7f2596d2fbd23f31525.gz
2006-12-14 21:58:11 +10:00
axel
52b74f9f34 Make sure debug() never alters errno, so that it can safely be called between an error and calling wperror()
darcs-hash:20061214100131-ac50b-b1c2e4819567fc35858233c265a26b934620fc6d.gz
2006-12-14 20:01:31 +10:00
axel
b932a9a084 Minor correction to script for extracting translation strings
darcs-hash:20061214014117-ac50b-fe792403646e1859116973494f2278c88f76072b.gz
2006-12-14 11:41:17 +10:00
axel
997f2dffbf Make syntax highlighter flag invalid command types as subcommands for 'command' or 'builtin' builtins. Also make sure that the '--' switch is understood by the highlighter
darcs-hash:20061214013537-ac50b-9d84fe371eed10ce48ade5ebe88b00442658d67a.gz
2006-12-14 11:35:37 +10:00
axel
1289e03134 Only complelete valid command types as subcommands for 'command' or 'builtin' builtins. Also make sure that the '--' switch is understood by the completions
darcs-hash:20061214000326-ac50b-3ee9130ebb3fcc9b2723686945cfca055c4f44a4.gz
2006-12-14 10:03:26 +10:00
axel
9a8e5e64ed Make sure that a command is never executed as the subcommand of the 'builtin' builtin
darcs-hash:20061214000152-ac50b-f1593dfeb4cecdbe48599ffe8d76a956989c7d24.gz
2006-12-14 10:01:52 +10:00
axel
774c050f92 Minor code tweaks. Move a few deeple nested pieces of code to their own functions. There are lots of other places where this should be done as well.
darcs-hash:20061213235838-ac50b-c3bedea3017910cc4f0d257ad6ee1da6b76efd12.gz
2006-12-14 09:58:38 +10:00
axel
478a319442 Make the builtins 'and', 'or', 'not', 'exec', 'command' and 'builtin' respect the '--' argument
darcs-hash:20061213154449-ac50b-d2ae8ff5a1cab8e753ddb97545071cc985051411.gz
2006-12-14 01:44:49 +10:00
axel
24fea5dd7b Code cleanup: Use a macro constant instead fo a literal for builtin exit codes
darcs-hash:20061213143431-ac50b-5c5cec623ecca9f52c7d44cfcb26f07fe2fcda39.gz
2006-12-14 00:34:31 +10:00
axel
2b05bdfa94 Update functions builtin so that default behaviour when not given any arguments is to print only names of all existing functions, not their definitions. Use 'functions (functions)' to get the latter.
darcs-hash:20061213142107-ac50b-16d0a9097ede4b0cd49847618d65fcbfee699393.gz
2006-12-14 00:21:07 +10:00
axel
6c8a559023 Drop unneeded '--' when using set builtin in various places
darcs-hash:20061212203727-ac50b-23fbb54bba0c5773e8a3dd2e5737ea8a670c801d.gz
2006-12-13 06:37:27 +10:00
axel
ca8c337c94 Drop unneeded '--' when using set builtin in the trap function
darcs-hash:20061212181841-ac50b-dd1fd50b80c6d3c759c123832bc6334613529ee6.gz
2006-12-13 04:18:41 +10:00
axel
8ccad65504 Minor fix to help generation to avoid creating a stray doxygen file in share/man
darcs-hash:20061212172518-ac50b-fec0999bd0b19259eaeee76c78c04b052392a6bb.gz
2006-12-13 03:25:18 +10:00
axel
fd11f294bc Use the math function instead of calling bc directly in various places
darcs-hash:20061212171118-ac50b-a40709edf008f3d725e3755d5282ae5a84818c88.gz
2006-12-13 03:11:18 +10:00
axel
b3fa76c1be Extend documentation for the math function
darcs-hash:20061212171037-ac50b-1b9d0f51b284925fe0fc3020774ec32bb1414ce7.gz
2006-12-13 03:10:37 +10:00
axel
d3dd9400e3 Make sure the rm command and not a wrapper function that could change its behaviour is used. This patch was written by David Bitseff.
darcs-hash:20061212122853-ac50b-4f3c9962bc6daed95c8f53a19af05bc3d924eac7.gz
2006-12-12 22:28:53 +10:00
axel
234034d302 Make sure cwd colors update when the variable changes. This is a common regression, it seems. This time it was caused by the repaint reductions added in 1.22.2.
darcs-hash:20061212101348-ac50b-970686fcd3317f19c6131cdc46885a841c68a6d6.gz
2006-12-12 20:13:48 +10:00
axel
edc20a7505 Update to the ':' patch by Nicholas Burlett. This patch makes sure that ':' style executing of a command is only performed if a regular call to execve fails. This should improve performance a mall bit in the common case.
darcs-hash:20061211190308-ac50b-d284fa30c8c633816898141b644bd3039f80cc62.gz
2006-12-12 05:03:08 +10:00
axel
3a29028f60 Fix broken example in the documentation for the begin builtin
darcs-hash:20061211134723-ac50b-6ea37b6dca30a85d00651129a762d8a9d95d40a2.gz
2006-12-11 23:47:23 +10:00
axel
f4af7603da Add completions for flac, written by David Bitseff
darcs-hash:20061210092326-ac50b-4de3e3473cdc73ef05052d4053f56dd790cc1403.gz
2006-12-10 19:23:26 +10:00
axel
63a28eb46f Add completions for oggenc, written by David Bitseff
darcs-hash:20061209085946-ac50b-747b61e4a0d717b5b9a5b7dcc3bdad8e33e79e18.gz
2006-12-09 18:59:46 +10:00
axel
b85d9ee737 Minor documentation update
darcs-hash:20061209011911-ac50b-2295056319c5b7a95e77df897f0310cd52c6580a.gz
2006-12-09 11:19:11 +10:00
Tassilo Horn
58042b0e9f ruby-gems-completion.dpatch
darcs-hash:20061208232818-c06f4-510633a992d3557967709713ab8ed8df94a36c05.gz
2006-12-09 09:28:18 +10:00
nickburlett
23759e6eca colon-command support
Shells such as bash, sh, tcsh, and ksh each support a "colon command" that causes the script to be
evaluated as a bourne script. In the case of bash and sh, this command is a no-op. For others,
it means the script has sh syntax.

To suppor this in fish, I've added code to launch_process that checks for a ':' as the first
character of p->actual_cmd. If it is a colon, the process descriptor is modified to call
/bin/sh, which should exist on any POSIX system.

darcs-hash:20061208220428-5830d-6bde4f1a3e8100296a60c21f9e47988e20688a77.gz
2006-12-09 08:04:28 +10:00
axel
1d3465698f Add dcop completions, written by David Bitseff
darcs-hash:20061208215855-ac50b-aa2ee1fc551ce7bca50d5979800e6674015a3737.gz
2006-12-09 07:58:55 +10:00
axel
b156f083be Fix off-by-one error making it impossible to edit the first element of an array using array slicing. Thanks to useer for reporting this bug.
darcs-hash:20061208133136-ac50b-3c8085ec61fcc3987356ee412133dba6c7f32d1f.gz
2006-12-08 23:31:36 +10:00
axel
f83b754cd4 Bump version number
darcs-hash:20061207224603-ac50b-a8f5ce18d44626814a15fc2c0b0fe0d51dae0567.gz
2006-12-08 08:46:03 +10:00
axel
df4a0d65bd Update comlpetions for the help function
darcs-hash:20061206131020-ac50b-f7f1a3c5aa85d90a6538583681167abca7f50e63.gz
2006-12-06 23:10:20 +10:00
axel
77b5532ce9 Make delete-or-exit work with multiline commands
darcs-hash:20061206122537-ac50b-80e3b3d6dff886eba162fbb8db5a82ff0f7a107f.gz
2006-12-06 22:25:37 +10:00
axel
d9ec65da4d Update user documentation - add section on internal completion functions, update todo list, minor documentation tweaks
darcs-hash:20061206000810-ac50b-08f12efdb74224abe46301d3722cd8180d8ba37d.gz
2006-12-06 10:08:10 +10:00
axel
4b9dcf1cf2 Add ant target completions, written by Nate Drake
darcs-hash:20061205235252-ac50b-112c0ff335e456ed0b419c6c5c7a889c517baed1.gz
2006-12-06 09:52:52 +10:00
axel
1fbac89a38 Do not highlight parameters beginning with a '-' as switches if the '--' parameter has been given
darcs-hash:20061204120707-ac50b-3c2099fd75ac615dfcdc0b0954713728142cd505.gz
2006-12-04 22:07:07 +10:00
axel
ceacfb83a8 Add completions for the env command
darcs-hash:20061204115838-ac50b-f75e067b50ee2cbc8f735110c34892613c53c4d9.gz
2006-12-04 21:58:38 +10:00
axel
d736c8cca6 Add completions for the locate command
darcs-hash:20061204114205-ac50b-1231627ff987bbb3dc4c7af1436cfdf17bd3a5c1.gz
2006-12-04 21:42:05 +10:00
axel
60769903a5 Add subcommand completion support to nice completions
darcs-hash:20061204111346-ac50b-913f68c7fcbf71117ac6d662423d64d05d38c6e5.gz
2006-12-04 21:13:46 +10:00
axel
8b73bac580 Rename __fish_complete_directory to increase consistency
darcs-hash:20061202233433-ac50b-48368a338773ad47807b0032389fd305d86b3275.gz
2006-12-03 09:34:33 +10:00
axel
c8162c2900 Flash commandline each time completion fails, not just the first one
darcs-hash:20061130235852-ac50b-de6e94a878e7a6de6ec9f34289437aec87d95b07.gz
2006-12-01 09:58:52 +10:00
axel
de181c91d5 Only flash commandline, not entire screen, when completion fails
darcs-hash:20061130235749-ac50b-436e5619f7818db7660269545de19e21c6a7e1b8.gz
2006-12-01 09:57:49 +10:00
axel
687ba1c9ef Add completions for the find command
darcs-hash:20061130231414-ac50b-4636dbd460ad23479c5740b22dcba011c2e140a3.gz
2006-12-01 09:14:14 +10:00
axel
02802b509d Make keyboard shortcuts that execute a shellscript function (^D, for example) a lot quicker. This is done by not changing the titlebar message or reexecuting the prompt. A full repaint is still performed though. This patch also changes the behaviour of the 'null' virtual keypress - it no longer reexecutes the prompt, it only causes a repaint.
darcs-hash:20061201163009-ac50b-65508b8e5aa3b2c73695feb0a47a718419868f8e.gz
2006-12-02 02:30:09 +10:00
axel
7f18dd6a4a Improve kill completions on non-Debian systems (They where fine before on Debian systems)
darcs-hash:20061130163230-ac50b-0f72c7a609b1218e30ec193362df13c76f4cb35b.gz
2006-12-01 02:32:30 +10:00
axel
2f7a472230 Remove fallback of using globals when universal variables are broken in config file- fish does the equivalen internally now
darcs-hash:20061130154838-ac50b-04861991dfc12fc4a7d1bb675dbffe4b78df920e.gz
2006-12-01 01:48:38 +10:00
axel
b8f2f46945 Use dircolors to set default colors for ls
darcs-hash:20061130154026-ac50b-d6d5e182a71516aa56ab16851e47510f2561b585.gz
2006-12-01 01:40:26 +10:00
axel
2570eb1ab8 Fix bug in save_function script
darcs-hash:20061130154006-ac50b-cb9ae4c46d3eced0fa432c47de996016519d29cd.gz
2006-12-01 01:40:06 +10:00
axel
d3062f9a97 Fix bed indentation in a few places
darcs-hash:20061130132431-ac50b-e17b1a55733c4f42264e88cb259a78b4a5cfc4e0.gz
2006-11-30 23:24:31 +10:00
axel
8619d17f43 Minor documentation, indentation tweaks
darcs-hash:20061129142102-ac50b-0ae69ec0878a54092f16261b314b34ef4eeeb5ba.gz
2006-11-30 00:21:02 +10:00
axel
8062eb3511 Makefile tweakage - make sure build messages suggest using correct make version
darcs-hash:20061129142004-ac50b-2776b3e6db870f6e04836a7d6e464e09d20f6274.gz
2006-11-30 00:20:04 +10:00
axel
e0322bf0e0 Add --without-gettext switch to optionally disable gettext support
darcs-hash:20061129141822-ac50b-64a78e7a3594827abe5024fdbf7d4c79ac21162c.gz
2006-11-30 00:18:22 +10:00
axel
ddc617f80a Fix bug in save_function that causes it to not create missing directory entries before saving function
darcs-hash:20061129140229-ac50b-525f2cff869a066d5c3624880125e37862a9fd3b.gz
2006-11-30 00:02:29 +10:00
axel
f64364cced Replace all internal uses of grep with sgrep, which is a wrapper around grep that strips away any GREP_OPTIONS. This is needed to avoid users who have added arbitrary switches to GREP_OPTIONS, thus changing its behaviour.
darcs-hash:20061129140004-ac50b-485ff6bfd71e9459ba62461f6e093ca5c9ddd664.gz
2006-11-30 00:00:04 +10:00
axel
32502bfac8 Don't use GREP_OPTIONS in 'contains' function - this is a modified version of a patch by David Bitseff
darcs-hash:20061126131150-ac50b-640bfaf2c3a4111809d9091631b79e35005e68b5.gz
2006-11-26 23:11:50 +10:00
axel
1f6a98ecb8 Make sure that non-exporeted variables can shadow exported ones. This problem was reported by David Bitseff.
darcs-hash:20061126130943-ac50b-b99cddc9a042545d5555b281d7e0aa8f667131d6.gz
2006-11-26 23:09:43 +10:00
axel
6ad0f141be Add missing rulers in faq
darcs-hash:20061124170631-ac50b-ee9823eb30fb84be07a512f7ad6dd46cbc2d0b44.gz
2006-11-25 03:06:31 +10:00
axel
0b6366aacb Fix missing code snippet in faq. Thank you to Binny V A for reporting this bug.
darcs-hash:20061124164641-ac50b-5c6594b320269aa5941b84d1d99eac70b636b332.gz
2006-11-25 02:46:41 +10:00
axel
deed3a63a3 Make completion descriptions on symlinks to directories have their own description
darcs-hash:20061123104145-ac50b-6b48de9c46593312d9c65368d17a45999d197e4a.gz
2006-11-23 20:41:45 +10:00
axel
cab80b452b Fix bug where tab completions for implicit 'cd' would ignore symbolic links to directories
darcs-hash:20061123104023-ac50b-7245f70e0f6fbbc97358e32c6dc7ca5258f24a53.gz
2006-11-23 20:40:23 +10:00
axel
338d32a7c6 Drop the old, unused fish manual page
darcs-hash:20061122185443-ac50b-aa46cf36aa38990ba49b4e08f7ce7a5c68abfdf3.gz
2006-11-23 04:54:43 +10:00
axel
88f15a6804 Simplify documentation building - again.
darcs-hash:20061122185333-ac50b-078910540c33e18265c7d5804d1f14f241ad597f.gz
2006-11-23 04:53:33 +10:00
axel
20b3f3b9a1 Add completions for the wajig command. These where generated by the create_wajig_completions.py script, written by Reuben Thomas.
darcs-hash:20061120152707-ac50b-fe478814bcc5edec9dc9d49d0da665b21ba8956c.gz
2006-11-21 01:27:07 +10:00
axel
1145a5d483 Touch up completions for builtin commands
darcs-hash:20061120152518-ac50b-cbd3d14af4fd2d67304278d442443decbac1ef7c.gz
2006-11-21 01:25:18 +10:00
axel
125ca9ff73 Minor edits, whitespace fixes, etc.
darcs-hash:20061120131412-ac50b-0d9bc9d3fb35b4c9831bdf3a606e9aa8df844478.gz
2006-11-20 23:14:12 +10:00
axel
bc1efb1556 Minor code edit - move a bit of code into its own function
darcs-hash:20061120131224-ac50b-974496cc800377e4e06475491f89998b9640fbba.gz
2006-11-20 23:12:24 +10:00
axel
7b5649097f Correctly handle multiple backslashes at end of line w.r.t. multiline handling
darcs-hash:20061120021934-ac50b-20d953c16711a4959cac9d435217309fc78aab98.gz
2006-11-20 12:19:34 +10:00
axel
c2e1d76400 Fix missing man-page generation when building from darcs tree. Also simplifys doc generation a small bit.
darcs-hash:20061120135336-ac50b-d3b7a4ce2ac6bcc307c57cfcd23db86a8ac411a8.gz
2006-11-20 23:53:36 +10:00
axel
f7435559a7 Simplify Makefile by using a wildcard to specify help files
darcs-hash:20061120010620-ac50b-1a838bdd75607a503bc8335bb39abd2aa11ac7e8.gz
2006-11-20 11:06:20 +10:00
axel
47afca1fdb Add missing help text for the save_function function
darcs-hash:20061119233640-ac50b-5fb02f7ce3ec3317aa57be2d936cc430b27276b4.gz
2006-11-20 09:36:40 +10:00
axel
372c811763 Support bold and underlined characters in help output
darcs-hash:20061119232734-ac50b-d426980ee143b44065a3ea2afc7d3808174acd5f.gz
2006-11-20 09:27:34 +10:00
axel
dd061b1dda Minor comment edits and removal of a warning
darcs-hash:20061118212459-ac50b-d6f4dddb560b4815ca850f9e9c3e8d7a5cf5ea70.gz
2006-11-19 07:24:59 +10:00
axel
eb3c99c54e Move the event handler for fish_color_cwd to init file, so it is not autounloaded. Also cache output of call to set_color command to improve performance a bit.
darcs-hash:20061118212147-ac50b-b0f44cca2acf7465dd9ff071aa35a3ac81f0615f.gz
2006-11-19 07:21:47 +10:00
axel
5d864e3f69 After processing a signal/event while waiting for commandline input, check the lookahead buffer for inserted characters
darcs-hash:20061118211531-ac50b-355fd5556f65e9cec3af5ed9e19a44af9bfe3b7b.gz
2006-11-19 07:15:31 +10:00
axel
1b71f91a01 Update documentation display code to run roff on the client system instead of pregenerating documentation and compiling it into program binaries
darcs-hash:20061117162438-ac50b-5c4c7f0bd8bf53a16e16ecfead9569e642b7160f.gz
2006-11-18 02:24:38 +10:00
axel
b30886228c Speed up history token search
darcs-hash:20061117233726-ac50b-eb7ef60b837a4dd5fee61c7a692d8210fdcc4719.gz
2006-11-18 09:37:26 +10:00
axel
f91de04269 Update todo list
darcs-hash:20061117150013-ac50b-ded7a41336a64df095ede01657a9af341f571d52.gz
2006-11-18 01:00:13 +10:00
axel
a3531db645 Add missing include in screen.c
darcs-hash:20061117145925-ac50b-267cb0b81f78672f3522cb320a0e951f84f70de2.gz
2006-11-18 00:59:25 +10:00
axel
1e8fe508f0 Tweak error messages in tokenizer a bit
darcs-hash:20061117145905-ac50b-ee735bf04d2dcbabc272c4f12cb64a8af51b83bf.gz
2006-11-18 00:59:05 +10:00
axel
54244fd33d Add a bugreport function for writing out a message about how to file bug reports
darcs-hash:20061117145825-ac50b-0480300cce24657aae9572b79f145d956db93593.gz
2006-11-18 00:58:25 +10:00
axel
4c1d1bb218 Complete using known repos in darcs
darcs-hash:20061116132251-ac50b-d62d1a1b08d21b57fa6f7e7ae105d9b77026fd39.gz
2006-11-16 23:22:51 +10:00
axel
903326ddf5 Make hitory token search interruptible. This code was written by Netocrat.
darcs-hash:20061117130612-ac50b-0f1f4e58c9794e705117bde0716f07b39e0176af.gz
2006-11-17 23:06:12 +10:00
axel
0105ec284d Don't intern as much completion data - this helps reduce memory usage when autounloading
darcs-hash:20061116130833-ac50b-b19887dc36b16476bb3b2a1593b23dd3325187ee.gz
2006-11-16 23:08:33 +10:00
axel
55b253152c Only do command description lookup if we have non-directory commands
darcs-hash:20061116130400-ac50b-47b7159276d607aab8c4a8d52a9c8a60a3f77819.gz
2006-11-16 23:04:00 +10:00
axel
6573d2b451 Use halloc to simplyfy allocations in function.c
darcs-hash:20061115141649-ac50b-aff0e3369bb19d6d88130781b13e598c9445b138.gz
2006-11-16 00:16:49 +10:00
axel
cfa9ecbfd2 Drop search highlighting when exiting search mode. Thanks to Philip Ganchev and Martin Bähr for the bug reports.
darcs-hash:20061116125803-ac50b-6eb95d76c3679a32db940a698466381ef7822b9e.gz
2006-11-16 22:58:03 +10:00
axel
b139201a33 A few additional input checks, minor code simplifications, and some indentation/documentation fixes
darcs-hash:20061115133046-ac50b-a6145bd9a63b6667357cc3ec603e185696bf1951.gz
2006-11-15 23:30:46 +10:00
axel
946b5d1528 Remove getpgid prototype from exec.c - this prototype seems to be no longer missing
darcs-hash:20061115132959-ac50b-d163141db6ad824ea0f6788338ebcec5001cbf5b.gz
2006-11-15 23:29:59 +10:00
axel
3b2670532a Make fish store universal variables locally if fishd can't be started - local changes are lost of the fishd connection is restored
darcs-hash:20061115123447-ac50b-bf17c55079e1196205cc3a4fd0ca22d9f539836c.gz
2006-11-15 22:34:47 +10:00
axel
d00bc973fe Use fcntl to automatically close fishd socken on exec instead of handling it manually
darcs-hash:20061115111857-ac50b-3e04a0bc16c8442bef02cf4a50777d4556b8eaa6.gz
2006-11-15 21:18:57 +10:00
axel
4768b37531 Add support for detecting and handling the screen-specific \ek\e\ escape sequence for setting the titlebar message in the prompt calculating code.
darcs-hash:20061114162125-ac50b-debe872f5916328f74a4560d0833b33f9eb89a40.gz
2006-11-15 02:21:25 +10:00
axel
ab162c6c25 Bump version number
darcs-hash:20061112210938-ac50b-af5fc653b1ec0da6832338aec2d56c98fba69897.gz
2006-11-13 07:09:38 +10:00
axel
5ed912bebc The incorrect pointer is used for the autounload callback, causing possible crashes
darcs-hash:20061112121725-ac50b-1f49f3f37c20d3fe2d4a12617e9dda139d2ad5ec.gz
2006-11-12 22:17:25 +10:00
axel
ec43090c16 Fix file descriptor leakage from completion pager
darcs-hash:20061112121613-ac50b-209d42c06401faf675ff123236823dcaa651d6f7.gz
2006-11-12 22:16:13 +10:00
axel
80759ee03f Fix exit status of delete-or-exit function
darcs-hash:20061112114544-ac50b-d5fd61b3819715057caba2dd8b48119df080edd1.gz
2006-11-12 21:45:44 +10:00
axel
816f473ac9 Add a few missing completions for the ls command
darcs-hash:20061111113315-ac50b-2a77e93a78571e1e83801128c1793c52bb03e13f.gz
2006-11-11 21:33:15 +10:00
axel
d59d3b4463 Minor code simplification in main.c
darcs-hash:20061111110650-ac50b-0d50d10087ea863ff0c79d05c614fdb06fa3b9bd.gz
2006-11-11 21:06:50 +10:00
axel
8784b78d84 Add a few more darcs completions. These are still unfinished, though.
darcs-hash:20061111105547-ac50b-0791e833664ff67d8ced1176577d8266fe4a3782.gz
2006-11-11 20:55:47 +10:00
axel
5005c67d76 Minor cleanups, mostly of code comments
darcs-hash:20061111105452-ac50b-24ab7965f6208ecdfced738e08cdb4cb4a565458.gz
2006-11-11 20:54:52 +10:00
axel
63732a99e9 Tweak Makefile, including fixing slight dependency problem
darcs-hash:20061111105314-ac50b-69703cc2575856a321515aa0554e97d1895a4606.gz
2006-11-11 20:53:14 +10:00
axel
04b7da336d Documentation updates
darcs-hash:20061111105208-ac50b-27e335ba701b021d3119206e91d68c8504d45c2b.gz
2006-11-11 20:52:08 +10:00
axel
5f69f2bb0c Make fish send a HUP signal to jobs when the terminal tells it to exit.
darcs-hash:20061111104840-ac50b-ae989e26bdb6c769ed93dcf11b742887c97858aa.gz
2006-11-11 20:48:40 +10:00
tassilo
fb62a35921 complete-eik-and-friends.dpatch
Completions for all tools which come with eix.
(http://dev.croup.de/proj/eix)

darcs-hash:20061110155925-a923b-fd06120f7ea5f65cb752fe437bfccb6f16c87b45.gz
2006-11-11 01:59:25 +10:00
axel
08787c7674 fix bug where off_t was assumed to be long long, causing display errors on systems with no large file support
darcs-hash:20061109175804-ac50b-b05ec0aa9ae6f7dd23b7432c321eff44b446397d.gz
2006-11-10 03:58:04 +10:00
tassilo
79de45eed5 better-emerge-completion.dpatch
- You don't need to supply the package right after -C or -u etc.
- Better descriptions

darcs-hash:20061109145341-a923b-a1a54d3a5a040396ccba350c125f3b1ba645c601.gz
2006-11-10 00:53:41 +10:00
axel
9bc9e1c08d Add completions for equery, written by Tassilo Horn.
darcs-hash:20061107211708-ac50b-6199e58e84bc8ee8729be5f2a5ff2f3518888bfc.gz
2006-11-08 07:17:08 +10:00
axel
3acdeb87a4 Update the emerge completions. They are now complete, ignore switch ordering, handle packages in different catagories with the same name. This update was made by Tassilo Horn.
darcs-hash:20061107211617-ac50b-fcd3108209671283b2d5553d3adf5a81a46869f9.gz
2006-11-08 07:16:17 +10:00
axel
9959e53985 Add alias function. Thanks to Tassilo Horn for pointing out that it was missing.
darcs-hash:20061107205539-ac50b-0053f828d40be5bcb088cdb8d669c239c201b433.gz
2006-11-08 06:55:39 +10:00
axel
4edb71325f Do not escape the ':' character. Thanks to Tassilo Horn for pointing this out.
darcs-hash:20061107205437-ac50b-51632ce51915d4ca8680ab4c4522bcd002a794b6.gz
2006-11-08 06:54:37 +10:00
axel
310768e8d2 Try to avoid the '
darcs-hash:20061107181911-ac50b-fda6044a81b3a09707f17d4017c2c3dacf4e1801.gz
2006-11-08 04:19:11 +10:00
axel
dc90e460fe Fix a bug in the help function causing help to fail when trying to open help for a builtin command. Thanks to Reuben Thomas for the report.
darcs-hash:20061107131211-ac50b-9727a813d940b34923b23b073c80a7b42c023486.gz
2006-11-07 23:12:11 +10:00
axel
d20c14b4bb Do not print a newline on empty greeting message. Thanks to Reuben Thomas for pointing this out.
darcs-hash:20061107130629-ac50b-553bc13390c0f040f4cecf2780e34da674e065fa.gz
2006-11-07 23:06:29 +10:00
axel
981f5782d8 Fix code for locating inputrc-file in users fish configuration directory. Thanks to Reuben Thomas for reporting this.
darcs-hash:20061103155335-ac50b-23ddaec5d0ca591b00e8a59ccc39e63ed8b9ff25.gz
2006-11-04 01:53:35 +10:00
axel
c2021b6225 Fix typo in documentation for the commandline builtin. Thanks to Reuben Thomas for reporting this.
darcs-hash:20061103143140-ac50b-b37fbfe68321f904936c002010045e467bc3a778.gz
2006-11-04 00:31:40 +10:00
axel
9de4dbdd03 Add the file that generated the wajig completions to the tree. This should not be installed but it should be included with the tarball. The file was written by Reuben Thomas.
darcs-hash:20061103142645-ac50b-0e13e41941b5dc990c60d775cdd8503ed8e54529.gz
2006-11-04 00:26:45 +10:00
axel
1a84a44cc2 Add completions for ps2pdf, dvipdf and dvipdfm commands, written by Reuben Thomas.
darcs-hash:20061103141945-ac50b-7592bb5784a55272747bbb0322281b9090e5fd65.gz
2006-11-04 00:19:45 +10:00
axel
80a9fc2fce Add mention of uninstalling old fish versions to the INSTALL file. Thanks to Jason Grossman for the suggestion
darcs-hash:20061103141254-ac50b-27f1f4741379bff54298b6c18d289947f66f91cf.gz
2006-11-04 00:12:54 +10:00
axel
8aac7e82c0 Try to detect seq versions installed by earlier fish versions and replace them
darcs-hash:20061103131621-ac50b-2748c958f8614f39fbaa7a45261877a912de539e.gz
2006-11-03 23:16:21 +10:00
axel
49e300d0ca Check if any libraries need to be linked in order to use iconv. This is needed on OS X. Thanks to Jason Grossman for the report
darcs-hash:20061103100004-ac50b-861ca2bc42414c475b1ab24399c8d240cf1e4651.gz
2006-11-03 20:00:04 +10:00
axel
136e99de62 Fix bugs causing all unmapped inputs below 31 to be interpreted as newlines. Thanks to Reuben Thomas for the report.
darcs-hash:20061103003457-ac50b-5f3fee63e211b12014e40dc3d8d8c94eaa22f24d.gz
2006-11-03 10:34:57 +10:00
axel
c41986a63f Add command specific completions for unrar command (No switches yet, only commands and files in archive)
darcs-hash:20061102235727-ac50b-7b7638289be4de52b4e3e3d109ad3167b7285023.gz
2006-11-03 09:57:27 +10:00
axel
bedf8ea55e Add support for completing using contents of tar archives
darcs-hash:20061102235548-ac50b-ec4a3b206c73f8fc44cc715b2a95fe6fef2d53c0.gz
2006-11-03 09:55:48 +10:00
axel
d8f1c0abcd Minor tweaks in the reader. Vastly simplyfu the insert_char function, and add a few code commants.
darcs-hash:20061102135019-ac50b-c5d4f7f307deb93b71e797bbb8a1d420a5790dc3.gz
2006-11-02 23:50:19 +10:00
axel
13a85ee3f1 Make sure fish has the currect exit status
darcs-hash:20061102134859-ac50b-692f9e9aff838ea375e5cf29eeae1e29b1b75338.gz
2006-11-02 23:48:59 +10:00
axel
fab18bae80 Updates to the documentation - add a few crossreferences, remove redundant listing of builtins and update the todo list
darcs-hash:20061102134725-ac50b-802d5cf8754ff94c4cc9533b2ff16a759e9aa2c9.gz
2006-11-02 23:47:25 +10:00
axel
6e24b26e2c Fix the code for ignoring infinite recursion
darcs-hash:20061102134537-ac50b-2dddd06dd77c362caf44c9160acc29b76278b230.gz
2006-11-02 23:45:37 +10:00
axel
7fb44d4d5f Spelling fix. Thanks to Reuben Thomas
darcs-hash:20061101231404-ac50b-8f5b08242aed565baf37035805d7b3614fe8022b.gz
2006-11-02 09:14:04 +10:00
axel
44f85d04f9 Fix formating issue for the documentation for the prevd function
darcs-hash:20061101221835-ac50b-03a9b5abc7e4a25cc75effecc734c20eb8fee342.gz
2006-11-02 08:18:35 +10:00
axel
bd71f0a096 Fix build error
darcs-hash:20061101181221-ac50b-227b2d2f6f5122c9f25c471872376884bdace13c.gz
2006-11-02 04:12:21 +10:00
axel
f7b656017f Use the same wording about license in Makefile and main.c.
darcs-hash:20061101144747-ac50b-fac8e3693445a8601f0c71ab191a64dac0ad7a67.gz
2006-11-02 00:47:47 +10:00
axel
7a8ca73376 Add missing include to fix a warning
darcs-hash:20061101105412-ac50b-1ee3d996330ad435954abfc8f827deb3f121adb5.gz
2006-11-01 20:54:12 +10:00
axel
9eb1826961 Update to buildscripts to fix dependency issues caused by new documentation layout
darcs-hash:20061101103112-ac50b-8ee49c3031b7802822c95ffcfee26d10e1870ed1.gz
2006-11-01 20:31:12 +10:00
axel
728a60bd67 Fix beginning/end-of-line input function, add beginning/end-of-buffer functions
darcs-hash:20061031220149-ac50b-6e6b8f523642bead730059dd96ee2d1290283b5e.gz
2006-11-01 08:01:49 +10:00
axel
0099c3c420 Add table of contents to begining of documentation. This involves some restructuring of the documentation files.
darcs-hash:20061031153614-ac50b-7a6e97e30ae759591028227466e76c574b931fd5.gz
2006-11-01 01:36:14 +10:00
axel
885d16fcd6 Fix casing and other minor issues in documentation
darcs-hash:20061031152316-ac50b-e68db9853d6e9461a0c054f1ea290704ccfc0a31.gz
2006-11-01 01:23:16 +10:00
axel
c4a8f4c890 Code beutification in build files
darcs-hash:20061031020656-ac50b-2385bb51d7df624e5691b7659120596600fd1d5d.gz
2006-10-31 12:06:56 +10:00
axel
c098cb5c87 Bump version number
darcs-hash:20061030160357-ac50b-29729cb4ba358e09f9c19e6d6e07e0c2489e14fd.gz
2006-10-31 02:03:57 +10:00
axel
63643ff17f Fix completions for which and type, which where broken by previous script updates
darcs-hash:20061030015221-ac50b-e4a0f2802e7a5dc4a1e594933f25cae00d9ea104.gz
2006-10-30 11:52:21 +10:00
axel
f83575f084 Make sure signals aren't blocked while autoloading, also add a few consistency checks to see that signals aren't blocked in critical places
darcs-hash:20061029210911-ac50b-50bec85c3d59d0332ba44f3ece1a012cdc3e8c4b.gz
2006-10-30 07:09:11 +10:00
axel
a6c00ca0d2 Minor edits
darcs-hash:20061028164448-ac50b-c53d5f235d01db3a11b01996b77411a213dc5303.gz
2006-10-29 02:44:48 +10:00
axel
c5eaefc8b5 Update autoloader to fix concurrency issues when changing loader path in autoloaded function
darcs-hash:20061028164122-ac50b-25f978df9afeb370a06ef7576ef03183034bc057.gz
2006-10-29 02:41:22 +10:00
axel
f16bb285be Documentation updates and clarifications
darcs-hash:20061028163229-ac50b-2b6d3712a97903788520c155326b0e7a193b5eec.gz
2006-10-29 02:32:29 +10:00
axel
09c348bef2 Add a shellscript function 'save'function' for saving the current definition of a function to file
darcs-hash:20061027225004-ac50b-2454152687ff84deec90e3d938a0288e62dc34e6.gz
2006-10-28 08:50:04 +10:00
axel
561ec7d5f5 Change the way the umask is used so that executable bits are ignored on file creation. Thanks to sqweek and Jamessan for explaining the issue.
darcs-hash:20061026151946-ac50b-3a55159343f1fe0a4edf3f077bcec8afd6f131f5.gz
2006-10-27 01:19:46 +10:00
axel
e98a604a21 Minor edits, remove unneeded code, add a few commants, correct spelling, tweak the todo list, etc.
darcs-hash:20061026102253-ac50b-eb42fdab9a9211d68386a563134856a96b870d90.gz
2006-10-26 20:22:53 +10:00
axel
3341fc888c Make the fish manpage in Doxygen and add it to the main fish documentation
darcs-hash:20061026102059-ac50b-2a7956bb4651b5ffe867e7c6eb26a29e2f15ad24.gz
2006-10-26 20:20:59 +10:00
axel
1faf7df371 Move out argument parsing into it's own function
darcs-hash:20061025205443-ac50b-2889624cadb3b92be13da523df32b178c773dbf7.gz
2006-10-26 06:54:43 +10:00
axel
3a128e1484 Use bitset to implement flags for jobs instead of wasting a whole int for every flag
darcs-hash:20061025204759-ac50b-ea07caa30782a1ea02d2cd8aa7cbc94474047a10.gz
2006-10-26 06:47:59 +10:00
axel
cdc52f7bde Add more comments to the history implementation
darcs-hash:20061025204650-ac50b-419d37d9ea68de0deee613524d06882a8e4c908e.gz
2006-10-26 06:46:50 +10:00
axel
e0899addcb Minor cleanups and improved error checking in reader code
darcs-hash:20061025203608-ac50b-213edeb462eaabce849d9cd13ffc30879e810bb8.gz
2006-10-26 06:36:08 +10:00
axel
c627509e59 Make al_pop return null on empty lists instead of crashing
darcs-hash:20061025203433-ac50b-5d3a18d788d6f36dffe1136664f029a500989db9.gz
2006-10-26 06:34:33 +10:00
axel
4502fc74c3 Fix spelling error in init file
darcs-hash:20061025203337-ac50b-576bd81401e332f94ecdff5665ca8da82c63fa8e.gz
2006-10-26 06:33:37 +10:00
axel
3b0ed061cd If the builtin help won't fit on-screen, and it can't be shortened, don't print it
darcs-hash:20061025203225-ac50b-8675f297a8aabea080edf7946d6f136296a6d7bb.gz
2006-10-26 06:32:25 +10:00
axel
dfa73c7cc1 Remove the --key-binding switch for fish
darcs-hash:20061025202836-ac50b-682015e2f5830a85ff520e89b0a951ca9d2913dc.gz
2006-10-26 06:28:36 +10:00
axel
12be24ef47 Update dependency list
darcs-hash:20061025163950-ac50b-161f81c51f5e923bfaf0aa9fda4d74f785e7aff7.gz
2006-10-26 02:39:50 +10:00
axel
c684b7c7c7 Update makefile to not try to delete old config files during install, and instead fail with a relevant error message. Thanks to Jamessan for pointing out the evilness of the old method and suggesting the new method.
darcs-hash:20061025163532-ac50b-ff394c53b8eb0d932894784bc25e086f9c9b65ec.gz
2006-10-26 02:35:32 +10:00
axel
4f22082a5c Do not remove trailing whitespace from function definitions, the may be a part of a function
darcs-hash:20061025122712-ac50b-6d7ab43572f71cafa5fddd65b8350498e2651b41.gz
2006-10-25 22:27:12 +10:00
axel
e3c1363831 Drop switch for saving of functions to file from the function builtin
darcs-hash:20061025105746-ac50b-942e878b01f5e080d7cf1e6414246b68b608b08f.gz
2006-10-25 20:57:46 +10:00
axel
6d413c8dc3 Fix bug where in rare cases calling the exit builtin would cause jobs to not execute even though the call to exit was blocked by running jobs
darcs-hash:20061025101402-ac50b-36456915671513f376a90c4455d1c9256f4a9030.gz
2006-10-25 20:14:02 +10:00
axel
32a49e45c8 Use the _t suffix for typedef:ed structs in complete.c
darcs-hash:20061024110352-ac50b-30768be6a11d9a5935be479fbdb430a42b0a95b9.gz
2006-10-24 21:03:52 +10:00
axel
b37d49a708 Fix bug in sed scripts for generating configuration files from templates. Multiple substitutions on the same line where ignored.
darcs-hash:20061023104315-ac50b-e5e84fb1e33fad98d81efccca0ae5dd57b479c7e.gz
2006-10-23 20:43:15 +10:00
axel
86b7023536 Decrease priority of fishd debug message
darcs-hash:20061022160329-ac50b-5f35fe90f6be184f02fc6514fc6047b25e4f93c3.gz
2006-10-23 02:03:29 +10:00
axel
287ab597ca Remove extra whitespace from warning message on directory transition
darcs-hash:20061022155759-ac50b-e1cd50b1b0d05413ad6e4d6c06a0f005e17d6976.gz
2006-10-23 01:57:59 +10:00
axel
c313f21066 A few more minor code tweaks to fish_pager, including added documentation and removing a few hardcoded constants.
darcs-hash:20061022115026-ac50b-590de2ef2f0cbe474ca4e41fd134e0c46d6877b3.gz
2006-10-22 21:50:26 +10:00
axel
e2dca4273a Add documentation, fix memory leaks and do minor code tweaks in fish_pager
darcs-hash:20061022110414-ac50b-e5ba776e795e0273d819d4eb51d5f60fba967db2.gz
2006-10-22 21:04:14 +10:00
axel
5a7a8003a0 Give search highligting precedence over other highligting types
darcs-hash:20061022094018-ac50b-0f688dc7e756f428c05e6977db6dc9cf9f642475.gz
2006-10-22 19:40:18 +10:00
axel
b83a7cb659 Make automatic history reloading actually work the way it should
darcs-hash:20061022012102-ac50b-e57a0dd2c918a2a8abd0210b9f8a2163ce664b74.gz
2006-10-22 11:21:02 +10:00
axel
da81328d75 Fix warning messages in fish_tests
darcs-hash:20061021225900-ac50b-992edf0914250ae090ef952717ef3a05cb9cfa6e.gz
2006-10-22 08:59:00 +10:00
axel
5ae4306418 Change meaning of ** to match both files and directories
darcs-hash:20061021224429-ac50b-38e46fa533baf9a46d207ab95bfa7af55abbe54a.gz
2006-10-22 08:44:29 +10:00
axel
ed36f30eae Fix crash bug in new history code - fish would segfauls in non-interactive mode on exit
darcs-hash:20061021103035-ac50b-a2a8d96416ff217cc5640f8f27db8dbac2c39b82.gz
2006-10-21 20:30:35 +10:00
axel
7b8ebdadd6 Fix flags for mmap in history, don't unload history items written to disk in order to keep proper ordering
darcs-hash:20061021101609-ac50b-563c0b14b620a6ef4bffe69202e97103b1d75ea5.gz
2006-10-21 20:16:09 +10:00
axel
bb4e166b37 Add some documentation to the new history code, and fix some minor code issues
darcs-hash:20061020230420-ac50b-39a08d68b82481514b0d6c1024a12618bf329d57.gz
2006-10-21 09:04:20 +10:00
axel
9dc1a7d5e9 Rewritten history implementation - uses mmap to save lots of memory and also allows incremental saving. The history is autosaved every five minutes and every five added entries
darcs-hash:20061020223649-ac50b-5e3e2c1e395feec0f5ac457149639f68d52d40f0.gz
2006-10-21 08:36:49 +10:00
axel
79f59e2a2d Decrease number of gettext messages that are buffered to save memory
darcs-hash:20061020223440-ac50b-ad0c0f685bfc851c62c340ee7d97fa1413bc9fca.gz
2006-10-21 08:34:40 +10:00
axel
8285242ff6 Add wrename wrapper around rename function
darcs-hash:20061020223347-ac50b-1735f7e63b87f021ca71c44e5278726d3e8debc3.gz
2006-10-21 08:33:47 +10:00
axel
c0a54955e7 Remove /etc/fish file before creating directory with the same name to avoid clash
darcs-hash:20061019234336-ac50b-569c1b492ab4d1f5f84dc8a4730700264c4e3e10.gz
2006-10-20 09:43:36 +10:00
axel
b2d4e85f17 Make any character except '/' legal in function names
darcs-hash:20061019154747-ac50b-f3ab0df1085b91ec0eadcceddb23f03d5b0247aa.gz
2006-10-20 01:47:47 +10:00
axel
a5868d67f5 Make failed process expansions expand to zero arguments, not to the original string
darcs-hash:20061019154127-ac50b-86975e62d9947819862a98e7b6fff3ff630f26b7.gz
2006-10-20 01:41:27 +10:00
axel
45f1263112 Minor code fixes
darcs-hash:20061019153950-ac50b-9a7d5939ce47cd5f8b7167a97b0e9c62315b7b6e.gz
2006-10-20 01:39:50 +10:00
axel
4683f4c989 Fix a number of bugs found using the warnings generated by earlier patch
darcs-hash:20061019153603-ac50b-4efb1ad1fe2cbe693a921648a0616a3d258d7933.gz
2006-10-20 01:36:03 +10:00
axel
ae16397e1c Fix occasional garbled characters in output of the set builtin
darcs-hash:20061019152418-ac50b-2ef6e93820deb5e272f28f893c51dca642a6b080.gz
2006-10-20 01:24:18 +10:00
axel
2d05b1c1b4 Add compiler warnings for some common incorrect usage of functions, such as forgetting to cast null pointers to variadic functions
darcs-hash:20061019151947-ac50b-4043638a7a830fa80fd918f92365f5afe3ff208a.gz
2006-10-20 01:19:47 +10:00
axel
ea998b03f2 First stab at directory transition. Test with care...
darcs-hash:20061019115023-ac50b-30c3fd51d8af8a616d63dfcac39370d7fe6d144e.gz
2006-10-19 21:50:23 +10:00
axel
52b2525b0e Make the callback for the file autoloader optional, and clarify its use
darcs-hash:20061019114632-ac50b-a0b3e1b3e7f26aa7cd674ade1a4fb2246f978ebc.gz
2006-10-19 21:46:32 +10:00
axel
ff96668151 Minor edits to documentation
darcs-hash:20061019114024-ac50b-e283638e3a34e1d38be58971f31900129230c598.gz
2006-10-19 21:40:24 +10:00
axel
d7576a409a Make history variable contain whole history
darcs-hash:20061019113916-ac50b-7e24780cdd591ae23210f0da2cb80a4cf09ba5c6.gz
2006-10-19 21:39:16 +10:00
axel
f6815629fc Give USER and HOME default values if undefined
darcs-hash:20061019113844-ac50b-def2288d589f479779166ed64903e99c8c8ab71a.gz
2006-10-19 21:38:44 +10:00
axel
8b3bcd2c4c Tweak initial capacity calculations to always be a Mersenne number
darcs-hash:20061018230246-ac50b-3da6ada42423f5bba3f8c3fdb366ce1f352cffde.gz
2006-10-19 09:02:46 +10:00
axel
c7bc31fe50 Fix exceptaionally rare crash bug in hash tables (happens once in every 2^32 hash lookups
darcs-hash:20061018230148-ac50b-4e67ecf1f9aeae8239c40101ae2ad6aa164c31bb.gz
2006-10-19 09:01:48 +10:00
axel
bab168f1d1 Fix yet another universal variable issue with initialization of the read buffer. This may fix fishd bugs reported by Philip Ganchev and Martin Bähr
darcs-hash:20061018164438-ac50b-c586b1ad36249853d613d0137b505377fe890d37.gz
2006-10-19 02:44:38 +10:00
axel
2ab04f4043 Skip command description lookup when no commands where found
darcs-hash:20061018155151-ac50b-5562479da23b89571f91ae1e2ed15e640ef0a094.gz
2006-10-19 01:51:51 +10:00
axel
b32bbb24b9 Fix bug in command description lookup code causing missing descriptions when command is given with a path
darcs-hash:20061018155059-ac50b-40936e573c07deb6b159a16d843f02ed60e79b49.gz
2006-10-19 01:50:59 +10:00
axel
f86f80fcd6 Properly handle character sets in universal variables
darcs-hash:20061017211129-ac50b-6aecd04b74a9122ff0e1b320a2cf48db36dd2194.gz
2006-10-18 07:11:29 +10:00
axel
d563e428e8 Avoid unloading an item currently being loaded by the autoloader
darcs-hash:20061016154022-ac50b-f4b74457a9e3acdcc70076f65dff4c1f00ac379f.gz
2006-10-17 01:40:22 +10:00
axel
5473711a20 Minor code simplifications in the reader and related libraries
darcs-hash:20061016153226-ac50b-830735fadfdf578dfa4c686a2a6cd98df0e50c95.gz
2006-10-17 01:32:26 +10:00
axel
91009ac9aa Fix hang bug when appending to killring
darcs-hash:20061016150017-ac50b-c1f789d9913949ebc44cd9d02af5c3555bdf51bf.gz
2006-10-17 01:00:17 +10:00
axel
49bff53370 Avoid reading before begining of buffer when moving/erasing word, fixes crash bug reported by Martin Bähr and further described by Philip Ganchev.
darcs-hash:20061016143912-ac50b-1deacc00f6c0438e6d760568ef5b1e47e3fe08c4.gz
2006-10-17 00:39:12 +10:00
axel
afcab9f1b3 Minor bugfix in the kill-ring code
darcs-hash:20061012223200-ac50b-6a046a89295f01937a38000ef6d016b7be5c19f1.gz
2006-10-13 08:32:00 +10:00
axel
841fdf3a04 Make kill-word and backward-kill-word accumulate kills in the killring
darcs-hash:20061012193000-ac50b-69f261df78b3957b9cec3d728fe05b8a27267c31.gz
2006-10-13 05:30:00 +10:00
axel
92446bda80 Yet another tweak to the move_word function
darcs-hash:20061012161317-ac50b-3b374e2b6c4c22f82c1cf018bf83298c8216fcb1.gz
2006-10-13 02:13:17 +10:00
axel
a620a1e5ed Update todo-list
darcs-hash:20061012140247-ac50b-ae6b9a26c5979dc7080ff3fea8dad618211227e1.gz
2006-10-13 00:02:47 +10:00
axel
5a8df6cc85 Fix major memory leak in autoloader introduced by recent autounloader patch
darcs-hash:20061012133012-ac50b-d03de17d9df4d41db075b24c2f7e48ad8c0f6417.gz
2006-10-12 23:30:12 +10:00
axel
b70b966f90 Fix the kill-line, backward-kill-line and kill-whole-line commands to work correctly with multiline editing
darcs-hash:20061012132732-ac50b-03fe641cf32ace645c88174528e849ab0d1ecb4b.gz
2006-10-12 23:27:32 +10:00
axel
97f7c2093b Drop warning in parse_util.c
darcs-hash:20061012120859-ac50b-1af2af938cd99630c2ea7b532e6213c26cc4ea6b.gz
2006-10-12 22:08:59 +10:00
axel
8ece4f3ddc Better string hashing function
darcs-hash:20061012010129-ac50b-3c420efe649e892c491d9d9830dda153ca395655.gz
2006-10-12 11:01:29 +10:00
axel
17a13a8eb7 Use the xdg-open command in the open function if it exists
darcs-hash:20061011161749-ac50b-f700489a238dafbd9aec4ef4f2eed731a8622b27.gz
2006-10-12 02:17:49 +10:00
axel
afaf156a42 Fix compilation issue in test suite,. Thanks to Martin Bähr for the report.
darcs-hash:20061010224721-ac50b-0bd07f325c2026d991cf9535941060fadd5869cb.gz
2006-10-11 08:47:21 +10:00
axel
c4f3b5e9ef Unload older autoloaded functions
darcs-hash:20061010224546-ac50b-7c3f38d32d4a413a9c0d8436bb13a5d65235f3a7.gz
2006-10-11 08:45:46 +10:00
axel
f5916358e5 Fix bug in the input buffering of messages to/from fishd causing garbled messages
darcs-hash:20061010222113-ac50b-1b6b01ab781ecbadf11a99b501f19a526ae7a7cf.gz
2006-10-11 08:21:13 +10:00
axel
e3e1b34fec Only show greeting in interactive mode
darcs-hash:20061010173154-ac50b-4831a80be03ed132ca5f709dcc5284d17d828d4e.gz
2006-10-11 03:31:54 +10:00
James Vega
18bb4ca826 Makefile.in: Update clean target to preserve builtin_help.c, user_doc, doc_src/builtin_doc and remove share/fish
darcs-hash:20060920040413-35ec8-2bc89e5dff67e2cab274676df2ca90eb1bb385e9.gz
2006-09-20 14:04:13 +10:00
axel
007e4662e3 Fix bug in contains function
darcs-hash:20061009215133-ac50b-3dc99c245e69c176f334046d9746d533a106cf2a.gz
2006-10-10 07:51:33 +10:00
axel
e11677ef66 Make the greeting message configurable using the fish_greeting variable
darcs-hash:20061009214905-ac50b-cc07bf2b76c5306f96d1bca7fd478d972de25de8.gz
2006-10-10 07:49:05 +10:00
axel
194167da32 New version of the xdg fix. Unlike the previous version, this one should actually work.
darcs-hash:20061009212440-ac50b-10d1cdd7441335d033171f5b71a8a97f8a1d1dfb.gz
2006-10-10 07:24:40 +10:00
axel
dafeac5c40 Fix compilation issues in xdg library caused missing headers. Thanks to Jamessan for the report.
darcs-hash:20061009201230-ac50b-4b5c183fbd88ef45a0ededdc3eea79191951fb5f.gz
2006-10-10 06:12:30 +10:00
axel
effea85984 Apdate address of fish homepage
darcs-hash:20061009152007-ac50b-403f605d46849a3b83192d872c4f6322bf97bb7e.gz
2006-10-10 01:20:07 +10:00
axel
0b34836c79 Update dependency list
darcs-hash:20061009151948-ac50b-89b0c12a9c8763517d85bf3e46f78b7c64846db6.gz
2006-10-10 01:19:48 +10:00
axel
f85ce201ee Do not use INTERNAL_SEPARATOR tokens to separate different parts of an unescaped string when unescape_special is false. This fixes a bug where weird characters would sometimes be printed in completion descriptions
darcs-hash:20061009151913-ac50b-47a9d3274b2399cef6fd0e12a908a606da2c4903.gz
2006-10-10 01:19:13 +10:00
axel
80ac4ddc2b Allow more than one argument to the commandline builtin. The arguments will be joined together using newlines
darcs-hash:20061009141608-ac50b-546c0f5897670bb7e628d6e7c63d687eac261ee1.gz
2006-10-10 00:16:08 +10:00
axel
9a0f712e29 Make the screen repainting code slightly more robust by keeping track of whether clr_eol may be needed to clear 'debris' from e.g. resizes
darcs-hash:20061009132642-ac50b-6162ed86a97771a8da4be2adff3ad6a4f1851616.gz
2006-10-09 23:26:42 +10:00
axel
286e110fb1 Various minor cleanups
darcs-hash:20061009103408-ac50b-a54797b9f89f51a8fc8f13674e8fd2329e989d4c.gz
2006-10-09 20:34:08 +10:00
axel
988a7fddf3 Indent empty lines after a block command correctly. Thanks to Philip Ganchev for the suggestion.
darcs-hash:20061009095931-ac50b-c958a6ec7a130019527e8e06d94af010d55ac3d5.gz
2006-10-09 19:59:31 +10:00
axel
a321505351 Allow escaped newlines within qoutes, expand them to themselves
darcs-hash:20061009012248-ac50b-a403705cfe166c7686a168bc017c50c316c28161.gz
2006-10-09 11:22:48 +10:00
axel
a074cd62bc Be more rigorous with the exit codes set by the parser and builtins
darcs-hash:20061009012102-ac50b-4f28c43dd1ccdcc04d1620a6da05218a99fd7337.gz
2006-10-09 11:21:02 +10:00
axel
7a8b468165 Allow Meta-newline to always insert a newline character
darcs-hash:20061009011529-ac50b-c8e3d77b569bc445e586c95aca01e4433fbff598.gz
2006-10-09 11:15:29 +10:00
axel
770fa771b6 Unknown commands should set the status flag to 127, as in bash and friends
darcs-hash:20061008234650-ac50b-d41e6ec3d0a6088b0addf5721aecf8d98ed866cd.gz
2006-10-09 09:46:50 +10:00
axel
414fa591b8 Make sure that if a syntax error occurs, the parser does not try to evaluate command substitutions in the command
darcs-hash:20061008234458-ac50b-96f9be42b12a9d2d2b61f6700b25c1242e1c385b.gz
2006-10-09 09:44:58 +10:00
axel
941b472b37 Make sure indentation works even if a line begins with whitespace
darcs-hash:20061008232351-ac50b-122ff623a2e428352477aa52afee9a71b40e569e.gz
2006-10-09 09:23:51 +10:00
axel
179f575593 Update history loading/saving to handle multiline editing
darcs-hash:20061008135046-ac50b-e830fe313e23f632b9c645227f41c49c8ce600f4.gz
2006-10-08 23:50:46 +10:00
axel
6400b60bdd Fix a few places where uncasted 0 was used as a null pointer in vararg functions, causing potential crashes on 64-bit platforms
darcs-hash:20061008132759-ac50b-23fe4f70a5143b8b187780403d8d21fb69c3e83f.gz
2006-10-08 23:27:59 +10:00
axel
0e03e872be Fis minor memory leak in screen handling code
darcs-hash:20061008004704-ac50b-3f40073c00f1ebd8e851c49e2df873c423637d0c.gz
2006-10-08 10:47:04 +10:00
axel
e51322ac81 Make it possible to use backslash to stay in multiline mode even when not at the end of the command
darcs-hash:20061007210631-ac50b-cc8513802c247d92c8d4d5f7bcf7a146aab67a1e.gz
2006-10-08 07:06:31 +10:00
axel
1e739166b3 Fix tokenizer bug causing bad highlighting in multiline mode
darcs-hash:20061007210521-ac50b-5cdfc808389c928b932b0e41ef14abd71b537633.gz
2006-10-08 07:05:21 +10:00
axel
560e53fd5f Add autoindentation support
darcs-hash:20061007005625-ac50b-11873654797eb1e98fd17893022bdf995be3e2aa.gz
2006-10-07 10:56:25 +10:00
axel
184d58cd36 Buffer calls to read() in the universal variable code
darcs-hash:20061006184539-ac50b-d8ecc4c45d0caae12cd60e32515a1218b37831d3.gz
2006-10-07 04:45:39 +10:00
axel
bcf3024cf0 Update todo list
darcs-hash:20061005201141-ac50b-5441cefd081ede3d7b02c5955c828ac7c3f132c3.gz
2006-10-06 06:11:41 +10:00
axel
9611a3b205 Color the ellipsis used by line wrapping as comments. Thanks to Philip Ganchev for the suggestion.
darcs-hash:20061005194026-ac50b-2708cfe79f28dbae9febc3fc5fcddb48c1fc8822.gz
2006-10-06 05:40:26 +10:00
axel
8ace1739f5 Add missing newline in error message for popd function. Thanks to Phipip Ganchev.
darcs-hash:20061005064419-ac50b-4770f393ea02761a5f4b4044b456d1b618d6da23.gz
2006-10-05 16:44:19 +10:00
axel
302516a747 Fix bug causing ls function to never color or classify files
darcs-hash:20061004235530-ac50b-815b8576b4d845c4d5929e034177c917fc050cae.gz
2006-10-05 09:55:30 +10:00
axel
ad5a6e0552 Move the code keeping track of file descriptor modification from reader.c to screen.c
darcs-hash:20061004233312-ac50b-9a10ff758375885ae78a5e5c04279c1976a037ea.gz
2006-10-05 09:33:12 +10:00
axel
873fd83307 Drop the optional checking of block type for the end builtin
darcs-hash:20061004233206-ac50b-cf72c879b4b58c8e5ba4e1dff5c2746ca2e8844f.gz
2006-10-05 09:32:06 +10:00
axel
d1078f8582 Detect and handle terminals size changes
darcs-hash:20061004214502-ac50b-aaf5b76a6281c0ba8757e794b0a802793ce92916.gz
2006-10-05 07:45:02 +10:00
axel
0ea668b260 Minor code cleanup
darcs-hash:20061004214204-ac50b-e1529fcedb1665f9871a95eba293a4a3c1150464.gz
2006-10-05 07:42:04 +10:00
axel
91c745e4b5 Add the possibility to set the cursor position using the commandline builtin
darcs-hash:20061004213948-ac50b-3f673edeb01390bb3f280812d90bc8469f2f8ba8.gz
2006-10-05 07:39:48 +10:00
axel
7d73349889 Add the possibility to set the input that the commandline builtin operates on
darcs-hash:20061004184939-ac50b-f2c3e2161a5bf77834a566462ac9942571c9d6ea.gz
2006-10-05 04:49:39 +10:00
axel
53a2c017fe Mangle very long variable values when using the set builtin to print variables and their values
darcs-hash:20061004181901-ac50b-a043695fa8fffe877970a51dd042c4bf623a770c.gz
2006-10-05 04:19:01 +10:00
axel
80ff583400 Use universal variables for fish_function_path and fish_complete_path
darcs-hash:20061004175519-ac50b-2e9dabc9ce1c21ebfcba020db8a8d84ef48433e9.gz
2006-10-05 03:55:19 +10:00
axel
0c7f74c78d Repain prompt after showing completion pager
darcs-hash:20061004102706-ac50b-51d0603c81f3125c01bad0901f8d2b745fc18e4a.gz
2006-10-04 20:27:06 +10:00
axel
13b1ea3f50 Various fixes to make double-wide characters (e.g. asian characters) work with the new multiline editing code
darcs-hash:20061001232136-ac50b-9bd771b382c00b71c5e2ee75df77ba2594b2a738.gz
2006-10-02 09:21:36 +10:00
axel
44ff9956b9 Second cleanup of multiline editing patch. Add code comments, use better variable names, etc..
darcs-hash:20061001212243-ac50b-6cd5abfcf6b7013fd23b27734ca29af27d945ca3.gz
2006-10-02 07:22:43 +10:00
axel
add1fa9208 First cleanup of multiline patch - add support for commands longer than one line and do minor cleanups, including removal of a few unused functions
darcs-hash:20061001205423-ac50b-2819a086fecb1bcd0ab1bc63bae76956f0181f54.gz
2006-10-02 06:54:23 +10:00
axel
8b2059c628 Add function to insert a range of new elements into the middle of an array_list
darcs-hash:20061001201728-ac50b-db2f7bccee53224f50347c8995b2f6496940243d.gz
2006-10-02 06:17:28 +10:00
axel
15724d0798 First stab at multiline editing
darcs-hash:20061001160258-ac50b-1a760913e64b96e30ff321d7fbe4069ca161cdfe.gz
2006-10-02 02:02:58 +10:00
axel
2839f5e567 Minor comment and documentation edits
darcs-hash:20061001155918-ac50b-8b5b4f5dbd8334bac1c0dc77fa18c8f3cfb4a878.gz
2006-10-02 01:59:18 +10:00
axel
67c820cee8 Minor tweaks to code validation for the for builtin (again)
darcs-hash:20061001155734-ac50b-6009b98dfccaf8f8292859f25c4d564c6b622f47.gz
2006-10-02 01:57:34 +10:00
axel
bce4c78d49 Further reduction of malloc calls in the history
darcs-hash:20061001152040-ac50b-085f4b8ce20c4793d5e592f7a213df04208630cb.gz
2006-10-02 01:20:40 +10:00
axel
421ebcc2d7 Be a bit more careful with memory alignemnt in halloc
darcs-hash:20060930121917-ac50b-6292696663684a38844b4c21360274b365e52969.gz
2006-09-30 22:19:17 +10:00
axel
92df4a6d91 Make sure M-d erases last character of word. Thanks to DynWind for the report
darcs-hash:20060929214804-ac50b-ffb19242fcbd594fb72016427704cb51cf9d0a22.gz
2006-09-30 07:48:04 +10:00
axel
22fe8e6a17 Fix bug in the setenv function (values wheren't exported!), thanks to Matrin Bähr for the report.
darcs-hash:20060928165405-ac50b-5ada00cfc08805677e1932c800ee79d68e35a68b.gz
2006-09-29 02:54:05 +10:00
axel
d0f1870735 Add syntax check to see that the for builtin is not given an insufficient number of arguments
darcs-hash:20060926124109-ac50b-b088397933fa7ea539e48fa9fcd461de8295f7ce.gz
2006-09-26 22:41:09 +10:00
axel
b71f5d09b0 Fix occasional off-by-one bug in syntax highlighting causing the character next to the cursor to be unhighlighted instead of the cursor itself
darcs-hash:20060924175723-ac50b-35757e87eb7076c2ecdecaed11c1bb673c571035.gz
2006-09-25 03:57:23 +10:00
axel
eb00ad77fb Make sure isatty docs are built into the main doc file
darcs-hash:20060919175509-ac50b-0174257f46e15d6e931bd8664e8a83ac498707b2.gz
2006-09-20 03:55:09 +10:00
axel
be886bc6df Unly use classifications in ls if stdout is a tty
darcs-hash:20060919165317-ac50b-c7923c7f5900ecc9814756743e6b0345efa382c5.gz
2006-09-20 02:53:17 +10:00
axel
7a5823fd60 Documentation updates from Beni Cherniavsky
darcs-hash:20060919145203-ac50b-bc87b8f5e6a18395e4bc3e364da4a40ad97850e7.gz
2006-09-20 00:52:03 +10:00
axel
81d61c467b Fix bug in for that causes crash on syntax error
darcs-hash:20060919142140-ac50b-48cbbdfd109e2b420d8e36acd5b13696445c0850.gz
2006-09-20 00:21:40 +10:00
axel
e91e3b6593 Minor bugfix in the switch parsing for the status builitn
darcs-hash:20060919142042-ac50b-b532e0308407d101d1f8b328a575a54e8bc46799.gz
2006-09-20 00:20:42 +10:00
axel
1db67a5105 Add completions for the wpa_cli command
darcs-hash:20060918222913-ac50b-9aeac9d1a5ecb4b6915625b07133b66ebab0b2bd.gz
2006-09-19 08:29:13 +10:00
axel
810faacd72 Make sure that syntax validator allows use of 'break' and 'continue' with --help even outside of loops, and make sure 'return' is only used in function definitions.
darcs-hash:20060918001518-ac50b-78977cbd17e4edce8d1b7d4c5426f478d42392af.gz
2006-09-18 10:15:18 +10:00
axel
6be3807cae Fix issue with ^W and other shortcurs sometimes not deleting anything
darcs-hash:20060916230532-ac50b-395d34e2c67d2be3d634638265a98239442fd6cd.gz
2006-09-17 09:05:32 +10:00
axel
4399503f4e Fix a bug in completion insertion code on string with escaped quotes. This bug was reported by David Benbennick.
darcs-hash:20060914151821-ac50b-c6628fc01a90865e0aec6e93b39b77c3877606fc.gz
2006-09-15 01:18:21 +10:00
axel
06b5fdc6e8 Update todo-list. Thanks to MArtin Bähr for the additions.
darcs-hash:20060913212744-ac50b-cb446bcebc04a89c7b065e2d3879b474740a005e.gz
2006-09-14 07:27:44 +10:00
axel
4037219dc0 Make sude completions include /sbin and /usr/sbin in PATH. Thanks to Xavier Douville for the suggestion.
darcs-hash:20060913171310-ac50b-a9e30533bc634f194f73fdee1e042d407f55fcac.gz
2006-09-14 03:13:10 +10:00
axel
1612ec50fb Fix bug in __fish_complete_subcommand, reported by Xavier Douville
darcs-hash:20060912231409-ac50b-c573d798d9d1abc197fcf50f3b52df2e44e1f70e.gz
2006-09-13 09:14:09 +10:00
axel
3bb0163598 Update todo-list again
darcs-hash:20060912221050-ac50b-1c16582591642beba13f83224dc7ef47cb9c5a0a.gz
2006-09-13 08:10:50 +10:00
axel
4d19aa7698 Update todo-list
darcs-hash:20060912215025-ac50b-448068ea065db5d2db4bb68b7e41ef4e986ecc83.gz
2006-09-13 07:50:25 +10:00
axel
f72de8e141 Ugly kludge to fix ugly header output from Doxygen in man-pages
darcs-hash:20060912155058-ac50b-50487271adc31d20a0e07e742a1cbe724068be6d.gz
2006-09-13 01:50:58 +10:00
axel
02eb856e44 Don't syntax highlight the character under the cursor, since that may hide the cursor. Thanks to Matin Bähr and Philip Ganchev for the reports
darcs-hash:20060911143935-ac50b-e1502365aeba0f4d97976f688329cbfc4b9871a4.gz
2006-09-12 00:39:35 +10:00
axel
c550f4eb21 Add completions for xpdf and xmms, written by Vikas Gorur
darcs-hash:20060911141848-ac50b-a541eafba3f0155b207963633262229330c01bea.gz
2006-09-12 00:18:48 +10:00
axel
00c25436d7 Make it possible to save a function when defining it using the -S switch
darcs-hash:20060908141241-ac50b-69a055a1e791e04e2b1208a5c36b9bb22c854c12.gz
2006-09-09 00:12:41 +10:00
axel
6107d63995 Add wmkdir function
darcs-hash:20060908141128-ac50b-9b67d1c5af9f746be18509bad3a0e8988efce29a.gz
2006-09-09 00:11:28 +10:00
axel
eafa0a7169 Bugfix in the wdirname function
darcs-hash:20060908141041-ac50b-8650eea2d071606654cad94553344ed12b4bf609.gz
2006-09-09 00:10:41 +10:00
axel
45d2b89780 Use halloc in history as well as other minor cleanups in history.c
darcs-hash:20060908123455-ac50b-9a3aa6a186fc883621c120cd0964a05ed595f2a4.gz
2006-09-08 22:34:55 +10:00
axel
72d73b7fdd Fix crash bug in cyntax validator when using an illegal command name. Thanks to Martin Bähr for the report.
darcs-hash:20060907201559-ac50b-34fa01bbc40eafddcc64a5111bebd88aab75a8d4.gz
2006-09-08 06:15:59 +10:00
axel
227a5da02c Fix syntax bug caused by new cmdsubs slicing feature. Thanks to Martin Bähr for the report.
darcs-hash:20060907201145-ac50b-8315f1c207883bfbe56db2ec8b3a8b3635e8dc84.gz
2006-09-08 06:11:45 +10:00
axel
e356bdaa8e Optionally add type of block to the end builtin to verify block nesting correctness
darcs-hash:20060905204347-ac50b-d0f87a700e38cdff9787be827b0df90b7f7baba5.gz
2006-09-06 06:43:47 +10:00
axel
697d524687 Clear error buffer before creating new error message to avoid bug causing all previous errors to accumulate
darcs-hash:20060905204020-ac50b-6ecc9e4c57a6b387431cef32c734ca525f05c26c.gz
2006-09-06 06:40:20 +10:00
axel
73f0d0bb48 Fix warning when help function is called with no arguments
darcs-hash:20060904201612-ac50b-63b83a589735021a6afd6be193500b549e3b25dd.gz
2006-09-05 06:16:12 +10:00
axel
200ebe43dc Add math shellscript function, which is a thin wrapper around bc
darcs-hash:20060904160023-ac50b-0d784182ca3930b0987d4338655b8717237e842c.gz
2006-09-05 02:00:23 +10:00
axel
ff2d354ef8 Bump version number
darcs-hash:20060904002509-ac50b-098c9c879257d689a975abd102f9b4d9fc00f592.gz
2006-09-04 10:25:09 +10:00
axel
3bef568955 Fix nagging warning message
darcs-hash:20060903234751-ac50b-c5d7f026323b5cab450e1770be572dcdf3ecc904.gz
2006-09-04 09:47:51 +10:00
axel
9a7be6db08 New status message for fish_pager
darcs-hash:20060903231209-ac50b-b8bad71cb9194a905918534fafec619118d61e21.gz
2006-09-04 09:12:09 +10:00
axel
40e2025327 Minor polish
darcs-hash:20060903230006-ac50b-c55a9272bb1cdb10312b8580c4c2a85654329e30.gz
2006-09-04 09:00:06 +10:00
axel
a819c863eb Skip bug causing autoloader to sometimes use the wrong version of a function. Thanks to Martin Bähr and Mystilleef for the bug reports.
darcs-hash:20060903225839-ac50b-5b1f3d5f0b8c54b999836c3384c22c2a31c31bd0.gz
2006-09-04 08:58:39 +10:00
axel
827c88e4a1 Fix bug where using the return builtin inside an if-block could cause the else-block to get executed
darcs-hash:20060831205320-ac50b-64ecbaa3ed5e32c1a815ba384a6831a8fd5e1b47.gz
2006-09-01 06:53:20 +10:00
axel
e2b7a078f4 Make "$foo\[1]" not be an array slicing. Notice the extra backslash
darcs-hash:20060831155932-ac50b-746462d2147f349f9a799cb4786a0abacd1d3d4a.gz
2006-09-01 01:59:32 +10:00
axel
6de0c4103b Add support for \cx backslash escapes for control sequences, syntax is borrowed from bash
darcs-hash:20060831155813-ac50b-cc93412afc87c1c391c3dbc5e7b8c9175efe01d8.gz
2006-09-01 01:58:13 +10:00
axel
b6e8171f01 Fix minor null pointer bug in the set builtin, fix bug causing the -n switch to be ignored, add missing completions for the -n switch to functions and set builtins, and touch up the documentation for said builtin a bit
darcs-hash:20060831154400-ac50b-dddbee79481e0e0a8da9fc025e8a15c466460a2f.gz
2006-09-01 01:44:00 +10:00
axel
b1439075c6 Updated definiton of move_word, more intuitive behaviour when a token consists only of non-alphanumerics
darcs-hash:20060831004525-ac50b-aa6675809f0f17fa266982374700a8a4ce6b2f5a.gz
2006-08-31 10:45:25 +10:00
axel
7df536023b Fix concurrency bug in autoloader causing memory leak
darcs-hash:20060828162734-ac50b-76c88ba8cc164646dcff16cb899633f1e10392e2.gz
2006-08-29 02:27:34 +10:00
axel
f5f15f9de2 Use dynamically sized buffer for reporting error messages in the parser
darcs-hash:20060828151913-ac50b-02453c13d107f88023b2331bf40daf6d329ac597.gz
2006-08-29 01:19:13 +10:00
axel
0e0a61119f Update english transliteration
darcs-hash:20060828130147-ac50b-2b07adaa3fd63cf0cd2b0122fef45b9aee365e37.gz
2006-08-28 23:01:47 +10:00
axel
6f058c687d Add fallback if SIGWINCH is unavailable
darcs-hash:20060828122515-ac50b-f2b8f1519bbbd62908a6648255bfb20bdce83212.gz
2006-08-28 22:25:15 +10:00
axel
53ea5d60b7 Minor code tweaks, mostly things like indentation, but also a ferw code reorderings
darcs-hash:20060828120244-ac50b-ad4be149ff245b6f799452f9eeff7bcc60af1526.gz
2006-08-28 22:02:44 +10:00
axel
9525f429c6 Dont let fallback implementation of killpg kill group 1
darcs-hash:20060828120122-ac50b-c5e3eb7392654feb378cdfcf11ab102418aa1386.gz
2006-08-28 22:01:22 +10:00
axel
548e379d6a Provide fallback version of getopt_long instead of checking for it's presense every time it is used
darcs-hash:20060828114305-ac50b-f4aad19e936fa42bbe84e51e72aa32445a469527.gz
2006-08-28 21:43:05 +10:00
axel
202d29de88 Restructure the autoloader. This fixes a very weird and rare Heissenbug, probably caused by a compiler bug, but also makes the structure of the code a bit more logical.
darcs-hash:20060828110019-ac50b-7be19eda18eb358163a9a5b7180c6c7d028e546d.gz
2006-08-28 21:00:19 +10:00
axel
23152ae8a6 Remove checks for gettext presense in mimedb.c and set_color.c. If gettext is unavailable, a fallback is provided.
darcs-hash:20060828105806-ac50b-47f092813ed70a03477d66c377edbe24f2aedf40.gz
2006-08-28 20:58:06 +10:00
axel
7310596dab Much more reliable getopt_long test. Idea from Netocrat.
darcs-hash:20060828102949-ac50b-bb55face2f3127018b6c79a72ee71e38f075232a.gz
2006-08-28 20:29:49 +10:00
axel
4afe49d7c6 Redo the -POSIX_C_SOURCE test to only add macros if they are found to fix things. Also add -stdÉ9 to CPPFLAGS if it is added to CFLAGS. Also add more comments, redo indentation and general file cleanup. Written cooperatively by Liljencrantz and Netocrat.
darcs-hash:20060828100334-ac50b-73eed298fdf5a853243413f0f12c235ffa9e787a.gz
2006-08-28 20:03:34 +10:00
axel
d7c3d2acbf Use OK as return value for del_curterm fallback
darcs-hash:20060828100046-ac50b-e52e7181ffb6fa5b1b3162ac3ae0aacc9bf7f5a3.gz
2006-08-28 20:00:46 +10:00
axel
f771fce892 Add a $version variable. Suggested by Martin Bähr
darcs-hash:20060828095840-ac50b-db561647eee1d06785448a4bfc6826eef5aec2b7.gz
2006-08-28 19:58:40 +10:00
axel
6522000bf0 Don't turn of file completion in svn completions if given an unknown subcommand
darcs-hash:20060827144853-ac50b-d09576fd6984eb18b06e0e7b1d8a88aa7b9d1df4.gz
2006-08-28 00:48:53 +10:00
axel
285abcc9bc Do not use the non-standard -i switch for sed
darcs-hash:20060827131554-ac50b-b969c2a56607ff46d028f5c44faabf2842814f0e.gz
2006-08-27 23:15:54 +10:00
axel
b15e8123ca If no completions have been found, use file completion even if command specific completions have disabled file completions. Suggested by MArtin Bähr.
darcs-hash:20060827005740-ac50b-41c3bf2bb91bcfc0122c317bcc2aca2061cd019e.gz
2006-08-27 10:57:40 +10:00
axel
1c86395ed8 Fix bug reportad by Martin Bähr that causes fish fail when using blocks in pipelines in interactive mode.
darcs-hash:20060827005252-ac50b-09c98537b9de72f0d4a2e5a28490b2e38fe321c8.gz
2006-08-27 10:52:52 +10:00
axel
3c8d2a1126 Don't use carriage return on initial painting of the prompt
darcs-hash:20060826022416-ac50b-16746f45142589e7fa83e95b6ee6a2fad98432c4.gz
2006-08-26 12:24:16 +10:00
axel
ed8cd08984 Fix minor memory leak in completion code
darcs-hash:20060826021948-ac50b-6fecba2056e47cb7c4e8499f2a51e1c0c23d0757.gz
2006-08-26 12:19:48 +10:00
axel
69537430ea Fix bug in completion code reported by Martin Bähr, as well as other bug evident in his bug report.
darcs-hash:20060826013722-ac50b-08de084a40af8ba5d708a7cd162087b7afbb7648.gz
2006-08-26 11:37:22 +10:00
axel
0a603a56c6 Minor bugfix for the completions for the complete builtin
darcs-hash:20060825154545-ac50b-eaa8b210ddc6fb6a089deb5c2b19723bd92228f3.gz
2006-08-26 01:45:45 +10:00
axel
046dd82995 Add minor new completion for make command
darcs-hash:20060825154516-ac50b-80284df4f7dd6cd332f2b21f5c9bdc359cc00eca.gz
2006-08-26 01:45:16 +10:00
axel
97c3e231f4 Allow slicing of command substitution output
darcs-hash:20060824133904-ac50b-fbc43cf30d8eb15e50343b786af77f85fb0b8d4e.gz
2006-08-24 23:39:04 +10:00
axel
76b782d576 Do not mix wide and narrow printf calls on stderr in set_color.c
darcs-hash:20060824133828-ac50b-399d9c8d4f6cd7c36ceb2991011d9dae23851d6f.gz
2006-08-24 23:38:28 +10:00
axel
ed5c1db392 Bump version number
darcs-hash:20060824105129-ac50b-999429675a936c246665940ee9154a524eae4be2.gz
2006-08-24 20:51:29 +10:00
axel
37f5db2bf9 Use terminfo to look up tab width instead of assuming 8 character tabs when calculating prompt width
darcs-hash:20060824104354-ac50b-bfb6428411a9c3f6e7a8df980b1005fdd1842a10.gz
2006-08-24 20:43:54 +10:00
axel
8a97bffd02 Spelling correction in documentation
darcs-hash:20060824103055-ac50b-8a81c73571b76dd2800787ca6e5bd29787eb9501.gz
2006-08-24 20:30:55 +10:00
axel
2fd48bce11 Fix use og uncasted 0 as null pointer in vararg function. Potential crash bug on 64 bit systems.
darcs-hash:20060824103014-ac50b-3fb830f548d383b8cef7a37b737c90f3ad30c4bd.gz
2006-08-24 20:30:14 +10:00
axel
d1a3e6abf5 Complete --do-complete argument should be optional
darcs-hash:20060824005315-ac50b-fa4fb8177bc11cf20f2f95fff43cd674a439bae0.gz
2006-08-24 10:53:15 +10:00
axel
1a29979bbd Ignore return code of exec_subshell when doing command substitution
darcs-hash:20060824005217-ac50b-9de976e1fe2d396b08b59619e46669bad6598ec2.gz
2006-08-24 10:52:17 +10:00
axel
69814e5066 Add documentation about new backslash escapes, and correct a broken link in the docs
darcs-hash:20060824005117-ac50b-39a1f56891c92e6a9b64b20fdd4bfd7d60090949.gz
2006-08-24 10:51:17 +10:00
axel
4dbac8f941 Add support for \a \f \v escape sequences, and make supåport for \e standards compliant
darcs-hash:20060824002609-ac50b-a1a9150d096647d9ab4c39d3245b528d7e75cd57.gz
2006-08-24 10:26:09 +10:00
axel
303473f20c Fix incorrect usage of the term subshell when command substitution was meant
darcs-hash:20060822143831-ac50b-cb5267a6434adcbd5bafb452d688bee06c23d4d6.gz
2006-08-23 00:38:31 +10:00
axel
480a29594e Minor tweaks to previous fish_pager patch to fix two bugs
darcs-hash:20060822135815-ac50b-35d9f643385ec29f9d8f93ca83d01e060de93cc7.gz
2006-08-22 23:58:15 +10:00
stew
dfe3dc1429 fish_pager_via_stdin
darcs-hash:20060822012451-2edb7-d8939fab708d8c605d2c7d0683c71f11db659bc9.gz
2006-08-22 11:24:51 +10:00
axel
2ea00ce444 help --help should be same as help help
darcs-hash:20060822005230-ac50b-b82c0665cae7427c09992f51e128e33cea44b41e.gz
2006-08-22 10:52:30 +10:00
axel
ac13bdeaa7 Work around Doxygen bug in man-file generation
darcs-hash:20060822004853-ac50b-3c5036484961825304059567670eea0ccb3cd643.gz
2006-08-22 10:48:53 +10:00
axel
22cb7dd2d7 Add horizontal ruler between documentation for builtins and commands
darcs-hash:20060822004810-ac50b-aa75e233685ce4e0c22cde27411550a13efbeff6.gz
2006-08-22 10:48:10 +10:00
axel
20698cc813 Remove duplicate include
darcs-hash:20060817155050-ac50b-bbbd5130688d1f3f5f4e4d48c4319faf4413995a.gz
2006-08-18 01:50:50 +10:00
axel
1ebf571da5 Update french translation, thanks to Xavier Douville
darcs-hash:20060814181448-ac50b-08e5a5e8eff3316411469730d03d756170e4b01a.gz
2006-08-15 04:14:48 +10:00
axel
7c822cbf30 Add a message to stdout in the help function describing where the help went if help opens an external browser window
darcs-hash:20060814181135-ac50b-6d9b05b714bc9576c260e87b5706e7d94dd73e39.gz
2006-08-15 04:11:35 +10:00
axel
90302d9232 Documentation correction
darcs-hash:20060814120540-ac50b-25daddbd1130d1b57837affa6c58542fd91ff59e.gz
2006-08-14 22:05:40 +10:00
axel
bee6805ff9 Check return value of del_curterm
darcs-hash:20060813230502-ac50b-2b7e30d3560097725789bf6aa659835e30c7a81b.gz
2006-08-14 09:05:02 +10:00
netocrat
65035c4dc7 Change null function to #define for del_curterm() - solves build problem on some BSDs.
darcs-hash:20060813030853-344c5-7aa2cc3c70044214d90263999f2312f8f10296a4.gz
2006-08-13 13:08:53 +10:00
netocrat
2b0d64184a Switch back to using -D for _POSIX_C_SOURCE and _XOPEN_SOURCE - solves build problem on Solaris 10
darcs-hash:20060813030806-344c5-ad0eec62d3ce93d98adcad4b93318b06538eef95.gz
2006-08-13 13:08:06 +10:00
axel
51d7159ba7 Update fish_pager interface, first try - this is the second patch to redo the fish_pager interface. Both this one and the previous one breaks the display of completions
darcs-hash:20060813014602-ac50b-3d30e3486021b1ffddf3f1a69e86ee51a6aac611.gz
2006-08-13 11:46:02 +10:00
axel
0a4819be27 Add support for buffering of input to a command, the first step to piping data to fish_pager instead of using the argument list
darcs-hash:20060813013803-ac50b-f8000d4c96162023411f84643f47221860b350b2.gz
2006-08-13 11:38:03 +10:00
axel
72ad4e0d3b Make fish pager use non-universal variables as well for getting it's colors
darcs-hash:20060811145528-ac50b-26be05f363f353d87ebceccf73385cd1af1c88f2.gz
2006-08-12 00:55:28 +10:00
axel
21de293a44 Fix missing quote in configure.ac
darcs-hash:20060811142930-ac50b-52d1bb6faf07b6a0ddac754cee16e899dd196679.gz
2006-08-12 00:29:30 +10:00
axel
8b395d05ef Switch to using AC_DEFINE instead of using -D switces in CFLAGS for a few macros that don't need to be passed through the Makefile
darcs-hash:20060811134859-ac50b-6efc59b9214909aa6804bed9c5919ed0e29ddf81.gz
2006-08-11 23:48:59 +10:00
axel
8392902cec Remove unneded include in Autoconf test. Thanks to Netocrat.
darcs-hash:20060811101005-ac50b-275a1240e7802f70eb763be42683b4d1f816a9b0.gz
2006-08-11 20:10:05 +10:00
axel
a5abdd2792 Always redefine del_curterm to be a no-op under bsd, seeme the double free bug can surface under ncurses as well. Thanks to Netocrat.
darcs-hash:20060811100756-ac50b-1b1010b696fdd9acf45ef85ab19e75f574e5198b.gz
2006-08-11 20:07:56 +10:00
axel
e784683b8a Comment away currently unused function to avoid warning. Thanks to Netocrat.
darcs-hash:20060811093051-ac50b-d025c406234bb31e36c0b0b7951b54c6fc62ed07.gz
2006-08-11 19:30:51 +10:00
axel
7fadf6c083 Do not call closedir on directories that failed to open. Avoids crash bug. Thanks to Netocrat.
darcs-hash:20060811092639-ac50b-6615f51aad8c2a81917db08e2dc8f4da3d7db2ef.gz
2006-08-11 19:26:39 +10:00
axel
7ff76476ed Remove non-unicode character in documentation file. Thanks to Netocrat.
darcs-hash:20060811092603-ac50b-59a68550fa3279662113ec080b18e7930bb02fe2.gz
2006-08-11 19:26:03 +10:00
axel
cd9102214b Rearrange includes so that config.h is always the first file to be included
darcs-hash:20060811011835-ac50b-847fc790288e3bb3f3a0ee7734ff278d2dc65bef.gz
2006-08-11 11:18:35 +10:00
axel
8da54a1955 Add two BSD-specific preprocessor macros to get additional prototypes. Thanks to Netocrat.
darcs-hash:20060810203756-ac50b-21259e610fc738c6ad990d88b0af74d56d6a38f8.gz
2006-08-11 06:37:56 +10:00
axel
6899e4e734 Do not use ! to negate shellscript results, this is unsupported on Solaris. Thanks to Netocrat.
darcs-hash:20060810194951-ac50b-7baee5f1ab962fac6fbb37f13e0a8ba134e910e2.gz
2006-08-11 05:49:51 +10:00
axel
486e0dbe84 Remove Solaris circular dependency in init file. Thanks to Netocrat.
darcs-hash:20060810193338-ac50b-2f1f68170610e1669fc20298fcce50a920c3f38f.gz
2006-08-11 05:33:38 +10:00
axel
441c109afb Remove unneded includes in autoconf tesst and add possibly needed one. Thanks to Netocrat.
darcs-hash:20060810192359-ac50b-8e38e24ada59928cf6f37e7ed625fe40a34fd5d7.gz
2006-08-11 05:23:59 +10:00
axel
4b0810d7e9 Added missing include in input_common.c, needed under FreeBSD. Thanks to Netocrat.
darcs-hash:20060810190246-ac50b-190b0b2e1fbcab0bd742f5b98f7e1e173b793800.gz
2006-08-11 05:02:46 +10:00
axel
51d58a6a7c Added missing line continuation. Thanks to Netocrat.
darcs-hash:20060810185244-ac50b-944f18d3bed557061e0625b805e51a6a743835ae.gz
2006-08-11 04:52:44 +10:00
axel
7a884e11a6 Avoid circular dependency in ls autoload. Second try.
darcs-hash:20060809231155-ac50b-52b1b1609307fb05d3d8f32c972b0a22476a1da8.gz
2006-08-10 09:11:55 +10:00
axel
c4acfdd87c Add missing files to make uninstall
darcs-hash:20060809230749-ac50b-2948357bb000b47b49b6310dabd84410fde3b461.gz
2006-08-10 09:07:49 +10:00
axel
41f8007a03 More header/autoconf fixes, improve winsize checking
darcs-hash:20060809225338-ac50b-7162a690e44e2272f4760723f5bf8cc135dc5952.gz
2006-08-10 08:53:38 +10:00
axel
8207030b21 Fix typo in seq.in
darcs-hash:20060809225230-ac50b-8371f5fd1a22526325d46f5a0565e3a38d51bb78.gz
2006-08-10 08:52:30 +10:00
axel
a2c70f495e Use string.h not strings.h in all cases
darcs-hash:20060809223452-ac50b-67c4b5af37ebd17ff6d7c1403ff3231272f35465.gz
2006-08-10 08:34:52 +10:00
axel
b11f366bb0 Add SIGUSR1 as fallback if SIGIO doesn't exist
darcs-hash:20060809222656-ac50b-9a1f5a202f012c836570041acb6064849e7b0de5.gz
2006-08-10 08:26:56 +10:00
axel
0e1a3c7c4a Add missing sys/select.h header needed on FreeBSD
darcs-hash:20060809222605-ac50b-7914c1eb0509a01bfb6d07a04e29e126218f89dc.gz
2006-08-10 08:26:05 +10:00
axel
d3a75a354a A new faq question and some minor documentation edits
darcs-hash:20060809114048-ac50b-0fe667bfe9cdcade6480137f2cf5982cc743288c.gz
2006-08-09 21:40:48 +10:00
axel
afc49dded2 Minor edits to the spec file
darcs-hash:20060809113614-ac50b-ab6ca380a48586ef95256ab8acb77da42854829b.gz
2006-08-09 21:36:14 +10:00
axel
49b232df84 Add a few missing dependencies for the spec file
darcs-hash:20060809113554-ac50b-cbc408698f102c3e3170a119acfafe7569c56592.gz
2006-08-09 21:35:54 +10:00
axel
248d11c462 Only write out titlebar message if it is of non-zero length
darcs-hash:20060809113424-ac50b-59988efa4dd788d6623023b642fd96989c4c9ada.gz
2006-08-09 21:34:24 +10:00
axel
6b1570b745 Tweak spec file as per suggestions from Michael Schwendt
darcs-hash:20060801135709-ac50b-07c6191b7464ba90dd64c78ae18df8b59e8e18ad.gz
2006-08-01 23:57:09 +10:00
axel
dc3634dc94 Add posix macros in configure.ac, not in Makefile, so that they will be honored by the configure tests
darcs-hash:20060801013123-ac50b-0c561ad5afd6e71230e29a25d467ed63c47b9f17.gz
2006-08-01 11:31:23 +10:00
axel
696b4df1c6 Add __EXTENSIONS__ macro when under Solaris
darcs-hash:20060801013018-ac50b-08925f5e5239e48ca3024717d5fec2e82138ca5a.gz
2006-08-01 11:30:18 +10:00
axel
65f4d6e866 The xpg4-path was mistyped. Fix it.
darcs-hash:20060801005736-ac50b-ef8389777e012f9f0b6edcb3df3d638158f87373.gz
2006-08-01 10:57:36 +10:00
axel
8833e8f4ea Fix minor nit in comment
darcs-hash:20060801005246-ac50b-56cb6d2245ce81d16807028749495b8e5a86cc3c.gz
2006-08-01 10:52:46 +10:00
axel
f29026b767 Fix another typo in common.c
darcs-hash:20060801004648-ac50b-4177620e4ee37ab1ad6f942faa3023cedeee9055.gz
2006-08-01 10:46:48 +10:00
axel
7ecf7c1fac Fix typo in common.c
darcs-hash:20060801003556-ac50b-fb20d6405d2d8fc8d343d040afbf3863bac07b2f.gz
2006-08-01 10:35:56 +10:00
axel
4a2fa5ea34 Fix typo in signal.c
darcs-hash:20060801002550-ac50b-3412377a694aac72d04e6eae3173ac0980724e60.gz
2006-08-01 10:25:50 +10:00
axel
03f6656af6 Use S_IS* macros instead of S_IF*, which are non-posix
darcs-hash:20060801002411-ac50b-e5afcbfe4adfc54333c982b43309091c1cbcc1c9.gz
2006-08-01 10:24:11 +10:00
axel
8e6dbe245c Changes to the fish spec file, written by Paul Howarth. Fixes spelling and broken dependencies.
darcs-hash:20060731212954-ac50b-630beb87b4563118c132dbf1c525d492b30df3eb.gz
2006-08-01 07:29:54 +10:00
axel
daf171aa86 Make grep call in seq fallback implementation Posix compliant
darcs-hash:20060731165626-ac50b-5560aebc877f49f4942b2c730273d8c2424bec24.gz
2006-08-01 02:56:26 +10:00
axel
d1bbb89389 Move over a few more objects to the new array_list functions
darcs-hash:20060731165511-ac50b-7858829e6a612e0c737d82d3d71d6833dc97f078.gz
2006-08-01 02:55:11 +10:00
axel
bd0c1573df Fix bug when using same array index more than once in a single array expansion, e.g. $PATH[1 1 1]
darcs-hash:20060731164816-ac50b-d3fc56b425035a4cbcf93a91435f9df9ca5997ac.gz
2006-08-01 02:48:16 +10:00
axel
2700a9b697 Use the new array_list functions in exec.c
darcs-hash:20060731163548-ac50b-3b503e0457b33c6bb2eda0040a9fa7f15e6afe32.gz
2006-08-01 02:35:48 +10:00
axel
474f6e90ff Use maxi not max in test suite when comaparing ints
darcs-hash:20060731163119-ac50b-94134f758d9cd7e87746fb93f187aa100c1b820d.gz
2006-08-01 02:31:19 +10:00
axel
7cbc11f1c3 Minor documentation additions
darcs-hash:20060731163027-ac50b-8532ecadc755400fc1be1f029fcec49412764da2.gz
2006-08-01 02:30:27 +10:00
axel
09f9d43be3 Drup minf/maxf from util.h, they are unused
darcs-hash:20060731162550-ac50b-6b4d29d73ef7d672c3c0f9070b528b96b9ec0c16.gz
2006-08-01 02:25:50 +10:00
axel
109e7455a8 Use the new array_list functions in builtin.c
darcs-hash:20060731162339-ac50b-e8a6bd2c327b8fa5527b739fba544994e1a809e3.gz
2006-08-01 02:23:39 +10:00
axel
9b95332aa9 Use the new array_list functions in builtin_set.c
darcs-hash:20060731161719-ac50b-28a669e7a83f966dba3527a148ff0fa0813fbd6b.gz
2006-08-01 02:17:19 +10:00
axel
cccd13db92 Add long and function pointer versions of all array_list_t calls
darcs-hash:20060731161641-ac50b-1850b9c2464ce1aa7ff2f1aa74140b526a6825f2.gz
2006-08-01 02:16:41 +10:00
axel
2c8a2c9f61 Add _POSIX_C_SOURCE macro, to enable Posix mode of various headers. Should help under Solaris. Thanks to Netocrat for the suggestion.
darcs-hash:20060731153213-ac50b-14f8402a743dd67f34e3699e993cef329fdd9427.gz
2006-08-01 01:32:13 +10:00
axel
f05e1f6e48 Always check strings sent to tparm
darcs-hash:20060731004804-ac50b-ddede984cbc114b5e79745aef768f85a587d3dc6.gz
2006-07-31 10:48:04 +10:00
axel
f439c4a484 Make calls to grep Posix compliant
darcs-hash:20060731003354-ac50b-5916d6d862fe8b4f31b64840296d24615b52d175.gz
2006-07-31 10:33:54 +10:00
axel
2fba53b113 Make PATH validation only run for interactive shells to avoid infinite loop
darcs-hash:20060731003311-ac50b-da0b49830e5a9042fbe7952a63ced2c86b8978fe.gz
2006-07-31 10:33:11 +10:00
axel
8a2846ed44 Add Solaris xpg4 PATH test
darcs-hash:20060731003111-ac50b-d8945adca50bbe9e86041835ed52a88e09f65701.gz
2006-07-31 10:31:11 +10:00
axel
91b63e4989 Make sure install-sh is executable in the Makefile
darcs-hash:20060730210506-ac50b-9869e637a768aefd6ec7db33cec5f2defb29eb36.gz
2006-07-31 07:05:06 +10:00
axel
89d876d0f7 Provide fallback of killpg function
darcs-hash:20060730205941-ac50b-ddcec32cc5ab74770b743fed3d131460ee576191.gz
2006-07-31 06:59:41 +10:00
axel
e79fdcb194 Provide fallback is struct winsize is not defined
darcs-hash:20060730205544-ac50b-26f34eb04b56924baa34f560fd274cf38413b5f5.gz
2006-07-31 06:55:44 +10:00
axel
60f0533821 Include siginfo.h in all signal-using files to make Solaris happy. Thanks to Netocrat for the report and a description of the solution.
darcs-hash:20060730202659-ac50b-1840aff40ec2467242bd107676c7426cdb14f643.gz
2006-07-31 06:26:59 +10:00
axel
0768cf7e53 Bump version number
darcs-hash:20060729173243-ac50b-641e89defc78e0660cac6601acfb22c73c1cd32e.gz
2006-07-30 03:32:43 +10:00
axel
bdd83d338c Minor edit of comments
darcs-hash:20060729173159-ac50b-f126469f9a6f221d94696d6292ca9a6c79a7a6e6.gz
2006-07-30 03:31:59 +10:00
axel
db369a9ad7 Minor documentation edits
darcs-hash:20060729173123-ac50b-9b895afc355cf5dc342fca3c276cfbf10c286bc2.gz
2006-07-30 03:31:23 +10:00
axel
aa895c6740 Fix minor bug causing spurious warnings on commandline. Thanks to Netocrat for the bugreport.
darcs-hash:20060728135203-ac50b-07471a032a389a26789ee871bf0dc25c6a91bd7a.gz
2006-07-28 23:52:03 +10:00
axel
8e06805f2d Fix for recursive autoload loop on ls
darcs-hash:20060728131756-ac50b-034430a6a44bec83419438fc1be0c0e603eaad2d.gz
2006-07-28 23:17:56 +10:00
axel
00360d8fbc Reorder switches to msgfmt in makefile to make Solaris msgfmt happy. Thansk to Netocrat for the report.
darcs-hash:20060728130715-ac50b-84c09814f3c2cb859d3efc8593161186dff6fcc3.gz
2006-07-28 23:07:15 +10:00
axel
3b365d9f8d Use unsigned long instead of uint in string hashing algorithm. Portability fix, suggested by Netocrat.
darcs-hash:20060728125421-ac50b-f3cfc12852739fdc1d3c43c46ed91a57e119964a.gz
2006-07-28 22:54:21 +10:00
axel
3835000e9d Include unistd.h and stropts.h in common.c to fix Solaris problems reported by Netocrat
darcs-hash:20060728125057-ac50b-455d5a9a1671ad3bfee61a46266b420aff1adb49.gz
2006-07-28 22:50:57 +10:00
axel
9bbe19bfb8 Minor fix to code for detecting help switches to builtins
darcs-hash:20060724124845-ac50b-546662123d4d30c314acb1fb74d3c9503332172b.gz
2006-07-24 22:48:45 +10:00
axel
787e99d901 Fix rare crash bug in highlighting code
darcs-hash:20060724124629-ac50b-114944bc776f9451feeb967f4af68919d3ac404c.gz
2006-07-24 22:46:29 +10:00
axel
713748c782 Some minor steps towards making vi-mode work
darcs-hash:20060723205203-ac50b-8125e733ed92689ba847ccbb9076d05910e701ac.gz
2006-07-24 06:52:03 +10:00
axel
c9eb74fa4b Add missing Substitutions of prefix and optbindirs variables in share/fish.in
darcs-hash:20060723170402-ac50b-551cff33ca0e831505b5891fada0a017c3ea1370.gz
2006-07-24 03:04:02 +10:00
axel
b2d940c25a Drop the init and shutdown function for the completion code
darcs-hash:20060722101651-ac50b-45f840a5b2f7461d976a8f5b859aa99bfa472274.gz
2006-07-22 20:16:51 +10:00
axel
2a7bc8c04b Plug very small memory leak
darcs-hash:20060722101549-ac50b-244f449244272fc1fea9b7d019d7c259f4746533.gz
2006-07-22 20:15:49 +10:00
axel
013d3dbb89 Make sure that the builtin source command is used when reading the init files, and not an overloaded function
darcs-hash:20060722095507-ac50b-4c7c51bec3f2d7224178cdacd2c9ec4ea3b073c3.gz
2006-07-22 19:55:07 +10:00
axel
0aff94dd4c Automatically sort manuals for builtins and commands when generating manual
darcs-hash:20060722095326-ac50b-6d1cdefa7fb3e6f71368be2a205e9ed9e84a1624.gz
2006-07-22 19:53:26 +10:00
axel
431850b4ec Add PACKAGE_TARNAME variable to makefile to make Debian packages happy
darcs-hash:20060721223909-ac50b-d970c0e6104e9be4eb082030193dbc4a667d10c3.gz
2006-07-22 08:39:09 +10:00
axel
e280d10033 Minor code edits. Use CHECK instead of a few error messages, add a few comments, etc.
darcs-hash:20060721010831-ac50b-e9ad82a3885969f9a43e6219523e2bd1867e26ed.gz
2006-07-21 11:08:31 +10:00
axel
8c4708b51e Make error message for ${foo}-type errors nicer
darcs-hash:20060720233319-ac50b-a5ffbe91b3c7dceba9f0f5e67a6e044fc5508f47.gz
2006-07-21 09:33:19 +10:00
axel
4ba9ac28bb Minor documentation tweaks and additions
darcs-hash:20060720133319-ac50b-ea71dc172f0c60de0d6f1effa2092ebb8d8ca2d9.gz
2006-07-20 23:33:19 +10:00
axel
4664d65af7 Add a few casts to avoid warnings in fallback gettext and friends
darcs-hash:20060720133125-ac50b-f357c1e8dc9c8dfbafa3baa51fcfb47525d337ba.gz
2006-07-20 23:31:25 +10:00
axel
1b7157a03f Update dependencies - This is needed to make fish build, since old dependencies include removed files. Thansk to Netocreat for the notice.
darcs-hash:20060720133045-ac50b-a5f84ded2003a5cd9c8fe5d32b9773d5498763b0.gz
2006-07-20 23:30:45 +10:00
axel
e1dd17a7dd Move over fish_interactive.fish to be created by the Makefile, not by Autoconf
darcs-hash:20060720132850-ac50b-2f1a4815a2a67541d3461768d00e185168727b92.gz
2006-07-20 23:28:50 +10:00
axel
5c8d9bd13c Minor duplicate code removal
darcs-hash:20060720130246-ac50b-b41daebb302e1cbadf2a4cf812d936edbda85926.gz
2006-07-20 23:02:46 +10:00
axel
1c9a173b3d Make sure autoconf tells the Makefile whether gettext is installed
darcs-hash:20060720130148-ac50b-9aef2d0e708a1253187a215d0407764510ba0ff0.gz
2006-07-20 23:01:48 +10:00
axel
a0c40fcf8d Print help message when the case builtin is misused
darcs-hash:20060719232226-ac50b-c61b4b6d498dbfbe83ee1bc4c37766e1a9662630.gz
2006-07-20 09:22:26 +10:00
axel
f36811b7be Improve error message for attempts to use Posix variable assignments
darcs-hash:20060719232020-ac50b-1564ffffc2e119e90d711605247637e7aac9da96.gz
2006-07-20 09:20:20 +10:00
axel
40ed01f6f2 Move a few pieces of implementation-specific kludges related to different gettext implementations out of env.c and into fallback.c
darcs-hash:20060719231149-ac50b-c930a77ae76249b27f800f1d61146482c8f005c9.gz
2006-07-20 09:11:49 +10:00
axel
b2e2743195 Remove translate.c. The gettext fallback functionality is moved to fallback.c, the wide wrapper is moved to wutil.c
darcs-hash:20060719225549-ac50b-0a55e805b04f4fe0afa99ea580901d62f39cdef5.gz
2006-07-20 08:55:49 +10:00
axel
1dc033f71c Fix temporarily broken fish_function_path during startup
darcs-hash:20060719224433-ac50b-d7b4480d694cb8f71ecee75e21c7530700d3c609.gz
2006-07-20 08:44:33 +10:00
axel
ba4166d17d Fix for the autoconf-changes in the porevious patch. The LOCALEDIR macro should be a regular string, not a wide string
darcs-hash:20060719165803-ac50b-1b76c45b77469c0a7dbf47b866ab127bd48780e5.gz
2006-07-20 02:58:03 +10:00
axel
46c6f7880b Set value of install path macros like DATADIR from the Makefile, not automatically by Autoconf using AC_DEFINE. That way we get correct expansion of ${prefix} and friends to their install-time value. This fixes a bug reported by James Vega.
darcs-hash:20060719144104-ac50b-05001b151a54bf893ff4c5a82c5f040529e27f57.gz
2006-07-20 00:41:04 +10:00
axel
bef7fff383 Do not test universal variable functionality since it relies on fish to be installed
darcs-hash:20060718173711-ac50b-1feae98c4c283bfa5bbc8dfedec3eb4641316a8d.gz
2006-07-19 03:37:11 +10:00
axel
0811613fe9 Make sure no error message is printed when failing to start fishd
darcs-hash:20060718173547-ac50b-cf1edeb25838b2df6120efa68855316939fb3f0f.gz
2006-07-19 03:35:47 +10:00
axel
a09abea737 Make sure to only close fishd socket if it is open on shutdown
darcs-hash:20060718172756-ac50b-3f36ee03489427823a36161b920b280b3494c1fa.gz
2006-07-19 03:27:56 +10:00
axel
fd4e5e6777 Fix crash bug in fish_tests when fishd is unavailable
darcs-hash:20060718172702-ac50b-72805efd3c9c7927a9fe37b6c80ef0dd276cde5f.gz
2006-07-19 03:27:02 +10:00
axel
57b3965518 Initialize etc/fish and share/fish from the Makefile, not automatically by Autoconf. That way we get correct expansion of ${prefix} and friends to their install-time value. This fixes a bug reported by James Vega.
darcs-hash:20060718164155-ac50b-8ec6c63d9c4e52db2c1884fcffeab78333367773.gz
2006-07-19 02:41:55 +10:00
axel
3e843f8219 Two minor build fixes, thanks to Hiroshi Sakurai
darcs-hash:20060717134217-ac50b-e7ec4f4ef1a4267486e746dacee79749048e3afe.gz
2006-07-17 23:42:17 +10:00
axel
2343ce5a0c Don't check for presence of Doxygen in the configure script, since it's no longer needed to build fish
darcs-hash:20060716225329-ac50b-7e48abb063dd717adfd00c571c5550978790d2bc.gz
2006-07-17 08:53:29 +10:00
axel
0122e35cb6 Bump version number to 1.21.9
darcs-hash:20060715133812-ac50b-8178fc0baca9c476cae37ee8cde7a0cbb0857231.gz
2006-07-15 23:38:12 +10:00
axel
c96382152c Fixes for the tokenizer to correctly return error values on invalid input
darcs-hash:20060715124005-ac50b-a3f06a51b53573a07db44f9ce6796f253b2596e9.gz
2006-07-15 22:40:05 +10:00
axel
af0bd61fb5 Add fix for build error in fish_tests
darcs-hash:20060715123903-ac50b-b9facd514360e534ab655177c8cd9cee0e9aa914.gz
2006-07-15 22:39:03 +10:00
axel
4a87c9895d Add -q/--query switch to the functions builtin. Works just like the same switch to set does. Useful for checking for the existance of functions in a script
darcs-hash:20060712174655-ac50b-14a98a15751bb5ddddf4ffb41521b616bef5e40c.gz
2006-07-13 03:46:55 +10:00
axel
036cc4e0fa The begin builtin should not alter the exit status
darcs-hash:20060712173141-ac50b-8d21f9f22ef55581521ccf923411e3458bd8109c.gz
2006-07-13 03:31:41 +10:00
axel
9e304fa734 Overhaul of the script autoloader. This should make sure that old scripts are unloaded and new scripts are loaded when the fish_function_path and fish_complete_path variables change
darcs-hash:20060712142242-ac50b-3966a0e96a32facc8bc1164d6d0837fc551e4733.gz
2006-07-13 00:22:42 +10:00
axel
6d9631d0d0 Add french translation (Thanks to Xavier Douville)
darcs-hash:20060711200205-ac50b-e9755dc6f6042fef73bd075582c9f8706360c8e2.gz
2006-07-12 06:02:05 +10:00
axel
bb04df2ac9 Minor code tweaks: A few extra input validations, spelling corrections, etc
darcs-hash:20060710223956-ac50b-22d3b2adf570872564abf7ab68bb223d0c4a5308.gz
2006-07-11 08:39:56 +10:00
axel
746a602515 Make sure that the / is only printed once in prompt_pwd function when cwd is root
darcs-hash:20060710223848-ac50b-ddb52c414fd8b08bd7c515c99cc4e05a3c479c7d.gz
2006-07-11 08:38:48 +10:00
axel
a41fd8f759 Update of the Swedish translation
darcs-hash:20060710161229-ac50b-f5dcf7369a24c83538960c443b58441b5359b75f.gz
2006-07-11 02:12:29 +10:00
axel
ba9fbc67da Fix bug in completions for the cd builtin that caused missed completions when using relative search paths and CDPATH. Also move the completions function to it's own file.
darcs-hash:20060709235518-ac50b-36c59205edbecd5c8967d8784fd43e46729c3cdc.gz
2006-07-10 09:55:18 +10:00
axel
ac40a3bcd0 Fix use of hardcoded path in completions for the help completions causing missing completions and warnings
darcs-hash:20060709233249-ac50b-9dfb4a708a8ecb3ae2e1882a0a5146aed6286d37.gz
2006-07-10 09:32:49 +10:00
axel
942dcd7d54 Fix bug where fish refuses to complete inside som command substitutions
darcs-hash:20060707153638-ac50b-7a50df000b5af04004fcaf0069e658de5e67b9ea.gz
2006-07-08 01:36:38 +10:00
axel
9830bf985a Fix psub deadlocks by once again considering a job as completed whenever the last process in the pipeline is dead
darcs-hash:20060707153539-ac50b-76842c851c3a4247c086e3242f70361b9d2d396b.gz
2006-07-08 01:35:39 +10:00
axel
7bb070d817 Fix two crash bugs in highlighter/parser for malformed lines (Thanks to Netocrat for the bug report)
darcs-hash:20060703104647-ac50b-9eb649322611a3e7fd95ef5f80acdc25ce09d11a.gz
2006-07-03 20:46:47 +10:00
axel
d56ab1d365 Switch from die_mem function to DIE_MEM macro in order to be able to give a line and file for the OOM message
darcs-hash:20060703103957-ac50b-8d7a860d931fd087f6d1759bc1e934dba1cfefe2.gz
2006-07-03 20:39:57 +10:00
axel
38175cdd30 Fix spelling error (Thanks to Netocrat)
darcs-hash:20060703103537-ac50b-dac14e53588671bdf9c288fdab5e71feb1b03347.gz
2006-07-03 20:35:37 +10:00
axel
436b1e10c6 Fix infinite loop when trying to init history without setting history mode name first
darcs-hash:20060622001228-ac50b-caa00ff803b6b1673d7672d8364f68afe89cee18.gz
2006-06-22 10:12:28 +10:00
axel
e59cb1da5d Add setenv shellscript function for csh compatibility
darcs-hash:20060622001123-ac50b-22e783ec5f77120a6960f28d735893d58e1a7db4.gz
2006-06-22 10:11:23 +10:00
axel
e42198b7c8 Implement fallback version of futimes instead of testing for it's existance in reader.c
darcs-hash:20060621141544-ac50b-4726e3f63644b64b8bbb5cd829383c1fc6f8d86e.gz
2006-06-22 00:15:44 +10:00
axel
2076944268 Use the intern function to share the strings used to describe various key bindings. This saves both performance, code size and memory use, but there is a pathological case where the user continually changes key bindings, resulting in more allocated memory than needed.
darcs-hash:20060621140344-ac50b-c7eb89a94a96538215f9a6737f8e4bacd6a801fb.gz
2006-06-22 00:03:44 +10:00
axel
407c96e943 Even more input validation
darcs-hash:20060621100746-ac50b-8aa5648c05a656829a895669be27c6fa4f1d8458.gz
2006-06-21 20:07:46 +10:00
axel
bf333f2a84 Remove common_init and common_destroy. Use halloc instead.
darcs-hash:20060621095838-ac50b-e4349a0ab02696cead5397efce3792c9d56c2d15.gz
2006-06-21 19:58:38 +10:00
axel
3ddd5e5981 Check exit status of close and fclose in a few extra places
darcs-hash:20060621095430-ac50b-52afcee91b856f706d6df6bcf2e3a6bc7d746e40.gz
2006-06-21 19:54:30 +10:00
axel
b016438c08 Update input validation. Always use the magic CHECK macro, which prints an error message including instructions on how to report this problem.
darcs-hash:20060621004836-ac50b-a47f296634eda0c469eb39034603015b1ad7ab5c.gz
2006-06-21 10:48:36 +10:00
axel
7268a4a4e0 Various code polish, including minor rearangement of builtin code to export fewer functions, a few additional input checks, and removal of the unneeded, exported error_max variable
darcs-hash:20060620212016-ac50b-f76c10eea23fab14a648ea83ed0c83a171b8fef9.gz
2006-06-21 07:20:16 +10:00
axel
51c6c5ea49 Make sure failed tilde expansion doesn't result in evaluating null strings in highlighting code
darcs-hash:20060620211621-ac50b-3d57cc28272f5222fb42a72f0f98f89af1ec60de.gz
2006-06-21 07:16:21 +10:00
axel
5688035680 Large number of sourcecode comment edits, and some minor code polish
darcs-hash:20060620005010-ac50b-eaeae9a6242a37c1e34831e1a0b2ee2b4e7a012e.gz
2006-06-20 10:50:10 +10:00
axel
43b6b703ff Make braces expand right-to-left, to make syntax more consistent
darcs-hash:20060617142652-ac50b-3c6ca24e37ae723fea6e74d1e4a9c66fd2f60c50.gz
2006-06-18 00:26:52 +10:00
axel
e007a5c203 The syntax for 'function --on-job-exit caller' was flat out wrong in the docs. Fixed.
darcs-hash:20060617141426-ac50b-835a389b29243023739315f21135f19c5f010c5a.gz
2006-06-18 00:14:26 +10:00
axel
f836bd41c0 Write commant at beginning of .fishd file mentioning that the file should not be edited
darcs-hash:20060617140406-ac50b-c3987895fbc747212a70618acf8a18b42601e8a8.gz
2006-06-18 00:04:06 +10:00
axel
c9e98c2eef Update function wrapper for cd builtin, make sure a local variable is used
darcs-hash:20060617131145-ac50b-1cef97b5e774713f659962b7e33f889be3081a3d.gz
2006-06-17 23:11:45 +10:00
axel
e94803152c Update rpm spec file, doxygen is no longer rewuired at build time
darcs-hash:20060617131036-ac50b-44d240f648cc020ee5307cf44c64ec72c0ca806b.gz
2006-06-17 23:10:36 +10:00
axel
07ff8a6c03 Documentation updates. Fixes a few formating bugs, adds various minor missing api documentation, fixes a few typos. Also fixes a few tiny code issues, mostly missing consts, etc
darcs-hash:20060617130708-ac50b-cc2ec5aa3e4bfb8e28d7b86441bfb4661f1dd7e7.gz
2006-06-17 23:07:08 +10:00
axel
9f10dd377e Fix bugs in the highlighting code related to detection and display of non-existing paths to the cd builtin
darcs-hash:20060617104128-ac50b-c9adecc8b95ab460f0c98c860e7640cdb91b4bae.gz
2006-06-17 20:41:28 +10:00
axel
6e0e7e0996 Fix a bug in the function wrapper around the 'cd' builtin that caused cd to sometimes return with a non-zero exit status even though the command did not fail
darcs-hash:20060616151848-ac50b-001698980eca6fadf9e470d829a532c305c84e38.gz
2006-06-17 01:18:48 +10:00
axel
907b2f8462 Make the validator show the help for a block command missing an 'end'
darcs-hash:20060616125616-ac50b-b895cc14ce9f26ec99ac90523b2a52d0dce66dd9.gz
2006-06-16 22:56:16 +10:00
axel
d2869d5140 Remove tiny and unlikely memory leak
darcs-hash:20060615160327-ac50b-01b0514c922104a7d36e3a9a0426bb3a671581b2.gz
2006-06-16 02:03:27 +10:00
axel
587e91d0c1 Include fallback functions in set_color command
darcs-hash:20060615152419-ac50b-e3ff8cffb004f7f381ca6d8e4bd5c039b451835d.gz
2006-06-16 01:24:19 +10:00
axel
aad3249b79 The license agreement int the docs explicitly state GPL v2, while main.c mentions GPL v2 or later. Removed the latter to avoid ambiguity.
darcs-hash:20060615152306-ac50b-6f24ed875ade3ea25d3536de92a8f16ab26c5e6c.gz
2006-06-16 01:23:06 +10:00
axel
081ab955af Slightly improve build system - dont link in ncurses into mimedb or set_color
darcs-hash:20060615135200-ac50b-e39889a0f566306f3ae1c7a39f2a7dd5c387fa2c.gz
2006-06-15 23:52:00 +10:00
axel
9a9d84c58a Slightly improve accuracy of calculations of prompt width
darcs-hash:20060615135023-ac50b-36a70fb2cab4f03b96db95ed3f7694b354e0b0ac.gz
2006-06-15 23:50:23 +10:00
axel
94d1322fc1 Update the set_color command: Add underline support, make the command a bit more rubust to missing ferminal features, and update documentation and completions
darcs-hash:20060615134915-ac50b-de1092e56490bbf1c58cc3422c239a2997645b6b.gz
2006-06-15 23:49:15 +10:00
axel
eed8b61a9e Add entry about changing shell to the FAQ
darcs-hash:20060615110539-ac50b-c610d35384039575a74711114262333e0b7eb99c.gz
2006-06-15 21:05:39 +10:00
axel
40558c2eb9 Fix highlighting of search matches, broken by earlier patch for underlining potential paths
darcs-hash:20060615105919-ac50b-fd54a58e3f7bdc93fd36e52891bafc7366c6e401.gz
2006-06-15 20:59:19 +10:00
axel
d677b468db Provide fallback implementation of lrand48_r
darcs-hash:20060615105315-ac50b-155e1836d0bdc8f398776a816898718066adcdce.gz
2006-06-15 20:53:15 +10:00
axel
4e38d3bc8c Minor comment edits, reindentation and other code formating changes
darcs-hash:20060615103706-ac50b-ad9f7060e40f5a786877e95f027688c90f43b6ec.gz
2006-06-15 20:37:06 +10:00
axel
36ae253a29 Minor comment edits, reindentation and other code formating changes
darcs-hash:20060615103646-ac50b-d7cde4cfca0c776127e9e161daefb74ee6d027ba.gz
2006-06-15 20:36:46 +10:00
axel
f673b06dd2 Give the 'random' builtin it's own seed state, to keep other users of random data from creating a generating a non-deterministic sequence of numbers even if the user manually seeds
darcs-hash:20060615103556-ac50b-7865016b4561c7c69afb1ba77f85adeda1da691e.gz
2006-06-15 20:35:56 +10:00
axel
e9e0643817 Check the return value of the unescape call at all places
darcs-hash:20060615011154-ac50b-b9c8f31c39fda44080ef885764ce572b24866cd5.gz
2006-06-15 11:11:54 +10:00
axel
358f412abb Highlight invalid directories red for the cd builtin
darcs-hash:20060615010038-ac50b-30ada1c67dcb393390f67cf709e433dafc8801b7.gz
2006-06-15 11:00:38 +10:00
axel
a983798295 Fix segfault caused by a backslash followed by a null inside single quotes
darcs-hash:20060615005931-ac50b-4c6be7129dfd2c3a5759a811b605ad32fceff758.gz
2006-06-15 10:59:31 +10:00
axel
52a0149e4f Set default highligting for valid paths
darcs-hash:20060614142241-ac50b-4f8bd79e788b3886ab8a1e5288da5b4cb9c2cdc5.gz
2006-06-15 00:22:41 +10:00
axel
8fdc46a105 Add support for hishlighting potentially valid paths - default behaviour is to underline them
darcs-hash:20060614132240-ac50b-448a4f8c43007262876d1ab6b52480e46b0e2981.gz
2006-06-14 23:22:40 +10:00
axel
63b02e308d Minor typo in configure script
darcs-hash:20060613234036-ac50b-6ccced250383c11f7babbb321de925312bad9761.gz
2006-06-14 09:40:36 +10:00
axel
7c97095bca Remove unused variable, and make a few variables static
darcs-hash:20060613172337-ac50b-6cae5390acdd278dc8709cfd870edfedfc0ba556.gz
2006-06-14 03:23:37 +10:00
axel
b62beaf47d Use variable arrays if compiler supports C99, this saves a small amount of memory
darcs-hash:20060613172251-ac50b-1e19294700c9b9b72e2254f676004e7d9dceea44.gz
2006-06-14 03:22:51 +10:00
axel
b2b1ec27d8 Add more emacs keymappings (Thansk stew for the patch)
darcs-hash:20060613163009-ac50b-16730da83d7e8ff45a51d10097a018411b11754a.gz
2006-06-14 02:30:09 +10:00
axel
6aa682755d Minor documentation edits for mimedb and fishd
darcs-hash:20060613154409-ac50b-5d1c80d67ee92a073078404ed662510573f7f9b5.gz
2006-06-14 01:44:09 +10:00
axel
2bc49b3291 Change name of fishd log file to be in line with name of socket file
darcs-hash:20060613154126-ac50b-1e33bbe55075035f2a4522aadb9ae500a3d302aa.gz
2006-06-14 01:41:26 +10:00
axel
cea3dfd0cb Decrease verbosity of fishd
darcs-hash:20060613153940-ac50b-37f934432f0fb1dbc0be4d03155563da56295bbe.gz
2006-06-14 01:39:40 +10:00
axel
d7d2c82a82 Fix bug in help builtin that caused fish to show index page instead of command-specific help
darcs-hash:20060613152224-ac50b-d1841f7069e4fee2c569fb0ee079efd3cfe7de8a.gz
2006-06-14 01:22:24 +10:00
axel
58aa1e75c1 Add completions for the which command
darcs-hash:20060613144807-ac50b-a0819777ec904700e644508a3b97e98f8c2acaee.gz
2006-06-14 00:48:07 +10:00
axel
0361423469 Major restructuring of the buildsystem, meaning that the documentation doesn't needlessly rebuild itself, and the size of the fish binary drops slightly
darcs-hash:20060613134328-ac50b-05ae75eb5cc081b680f38e8866fac00a679cc266.gz
2006-06-13 23:43:28 +10:00
axel
9aee2b7c9c Drop most 'const's from function prototypes
darcs-hash:20060612214742-ac50b-9b0801e8a7c07d6ab3f0acf569e1d6eb1eeb3f0e.gz
2006-06-13 07:47:42 +10:00
axel
2c95e087b2 Minor updates to swedish translations
darcs-hash:20060612205455-ac50b-24d5c1f05ff1fd4bec0d5ad4fffff7ff3e1d3abd.gz
2006-06-13 06:54:55 +10:00
axel
5d5ee87a59 Minor code edits
darcs-hash:20060612205438-ac50b-4d7092740d5d35af3da06d0e6e99551d1cdfa123.gz
2006-06-13 06:54:38 +10:00
axel
c60b62de73 Minor addition for completions to the patch command
darcs-hash:20060612203328-ac50b-e06d8dd7f9325cc06f59f6386eaedb181f1bd881.gz
2006-06-13 06:33:28 +10:00
axel
2e5821c17d Do not change status when the 'exit' builtin is called with no argument
darcs-hash:20060612165137-ac50b-0281941e35c5f8b619460f67d24a89caec475815.gz
2006-06-13 02:51:37 +10:00
axel
f46145a6b3 Do not change status when the 'return' builtin is called with no argument
darcs-hash:20060612164854-ac50b-5f428c819e8dafb44b591150d1965c5158854781.gz
2006-06-13 02:48:54 +10:00
axel
c61f6ceea6 Minor update to english 'translation'
darcs-hash:20060612155743-ac50b-d7b5cabd2dfd90932b762f26d4ebf0602b78f67d.gz
2006-06-13 01:57:43 +10:00
axel
d32751df13 Use halloc in a few more places, including the highlight code
darcs-hash:20060612141233-ac50b-1c44411dd31cdc31d6ccb226f567c308c4fc0f55.gz
2006-06-13 00:12:33 +10:00
axel
038dcca143 Include user documentation with standard tarballs - this means you no longer need Doxygen to build fish, and should make life easier for packagers
darcs-hash:20060612110743-ac50b-0dcfea7ce14856840ee66afb2c70bb23fcbfee6f.gz
2006-06-12 21:07:43 +10:00
axel
d79e8c7f62 Documentation updates, mostly corrections and cla<rifications to the docs for a few builtins
darcs-hash:20060608235811-ac50b-76b4fd54cb0911dd00f19f4a7c761f188d6ca068.gz
2006-06-09 09:58:11 +10:00
axel
af8cb6fe87 Minor code edits - add a few braces, a few minor safety checks, etc.
darcs-hash:20060608235719-ac50b-bec405da5ae101ff50bb3390bb83ef8b0948e4e9.gz
2006-06-09 09:57:19 +10:00
axel
5855f78010 Edits to source code comments
darcs-hash:20060608235557-ac50b-052e5c8f2cceb554064d7408573f277275903e7b.gz
2006-06-09 09:55:57 +10:00
axel
f7118e769f Add more function input validation checks
darcs-hash:20060608235212-ac50b-25fd55f96356af65d4da1eec100cc954b4a9f81e.gz
2006-06-09 09:52:12 +10:00
axel
93ae00e8e5 Do input validation in various functions in function.c and complete.c
darcs-hash:20060608000145-ac50b-1088c3f5e3c1ad2759c13400e5dda2d21858fedc.gz
2006-06-08 10:01:45 +10:00
axel
d7eb084b9d Make sure that empty completion descriptions aren't translated to the gettext version information
darcs-hash:20060607235601-ac50b-7b8d4d01f4e30d0722c6e269f9d46fb354c5f4b6.gz
2006-06-08 09:56:01 +10:00
axel
6e1548b821 Remove period from end of completion descriptions for telnet command
darcs-hash:20060607233312-ac50b-cb10498f174b72fb53d7e47ab93fcd8af72676c9.gz
2006-06-08 09:33:12 +10:00
axel
5381c6cf93 Fix off-by-one error when reporting line number of function call in stack traces
darcs-hash:20060607233206-ac50b-d8dcddb8a12a080d3e6ec50e50c420d70eeb8401.gz
2006-06-08 09:32:06 +10:00
axel
20e5d298a0 Updates, bugfixing and minor edits on the test suite
darcs-hash:20060605133133-ac50b-e2ee5868f9f3ede147c7059d90c0f520ed905a5f.gz
2006-06-05 23:31:33 +10:00
axel
39e9974e71 Fix some typos and bad wording in hte faq
darcs-hash:20060605100434-ac50b-539b8cebf367ad1c1e05b78fb412389c9f78fc4b.gz
2006-06-05 20:04:34 +10:00
axel
d2bd3e4919 Fix minor typos in code comments
darcs-hash:20060605004201-ac50b-66c51908cd1f23307042991b32ccbed487685500.gz
2006-06-05 10:42:01 +10:00
axel
04b142208d Make it possible to specify scope of a variable to be erased or tested. Also make sure set exits with a non-zero exit status when erasing fails.
darcs-hash:20060604201451-ac50b-4ea0212c513b33be40559dfe8d65c1446c53f682.gz
2006-06-05 06:14:51 +10:00
axel
cf35a8e3a5 Add documentation about support for negative indices
darcs-hash:20060604094203-ac50b-6cf671235549eb79d3464a15398b6511057dedde.gz
2006-06-04 19:42:03 +10:00
axel
e7e3e8ee74 Add support for negative indices in arrays. Negative indices count from the end of an array, so -4 is the fourth index from the end
darcs-hash:20060604093532-ac50b-6e22b2f2ccfe94375fe4c32e41ccec08ca501744.gz
2006-06-04 19:35:32 +10:00
axel
6fd69bdda8 Many minor edits and clarifications to the documentation, including comments about the exit status of a few commands
darcs-hash:20060603231517-ac50b-03d252516eef21d4dd3a2ba0f5bb68e82525213b.gz
2006-06-04 09:15:17 +10:00
axel
a85f4cc1c4 Swedish translation updates
darcs-hash:20060603223800-ac50b-8170191f3d233eab438709c35c0f1c69c622756e.gz
2006-06-04 08:38:00 +10:00
axel
07af5f4832 Add english 'translation', which does nothing except change the type of quotes used
darcs-hash:20060603223731-ac50b-9e222fa36b0b71b5690dc5674905000eea9b11c1.gz
2006-06-04 08:37:31 +10:00
axel
446272eee6 Minor code tweaks, including making sure builtins are not run if an io redirection issue occurs and removing a lot commented debug code
darcs-hash:20060603223533-ac50b-204ff1fb1a4912565044e7bc4b86102a7eeba192.gz
2006-06-04 08:35:33 +10:00
axel
48ca253097 Minor spelling fixes
darcs-hash:20060603223228-ac50b-b4f7b190baf3c41bf23c224f5d68e8888dd4eaed.gz
2006-06-04 08:32:28 +10:00
axel
da2a757dff Add missing help message for a few errors in the set builtin
darcs-hash:20060603223150-ac50b-b2c731e724410a8a192655940064be307214c149.gz
2006-06-04 08:31:50 +10:00
axel
6fada015b6 Drop validation of function code on new function definition - the code has already been validated
darcs-hash:20060602021757-ac50b-02bad63baf4826801ec0433468ec78d9b4a4c0f7.gz
2006-06-02 12:17:57 +10:00
axel
a1a2773cbf Make sure code validation error output for e.g. the complete builtin can be redirected, and that it has the prefix 'complete', not 'fish'
darcs-hash:20060602021517-ac50b-5e566aefbd1c9bcb3a5f11f9fc1125d8c1d9e936.gz
2006-06-02 12:15:17 +10:00
axel
67f216fa55 Highlight invalid use of variable expansion operator
darcs-hash:20060601230438-ac50b-165ec1515e0e02674a992a1f0309a567aa6828de.gz
2006-06-02 09:04:38 +10:00
axel
8986e05b94 Minor code cleanup
darcs-hash:20060601224217-ac50b-5e82554d224ffd9f4f6b79fe365d855795058100.gz
2006-06-02 08:42:17 +10:00
axel
7c016c56e3 Only hide /private directories in pwd function under OS X
darcs-hash:20060601222300-ac50b-b08a9425d33cf41d60aa0a42edffa32f521fc2a3.gz
2006-06-02 08:23:00 +10:00
axel
0602044723 Add completions for 'cp'.
darcs-hash:20060601221808-ac50b-f9f8d90f6e53fe6bc41d124b00ded09c4979af6d.gz
2006-06-02 08:18:08 +10:00
axel
4ffd2afccd Fix some minor 64-bit uncleanlieness - thanks to James Anthill
darcs-hash:20060601194231-ac50b-a6b9b94379ba1d5bb6c61f7fad4652c8f748b25f.gz
2006-06-02 05:42:31 +10:00
axel
ec58ffa641 Bump version number
darcs-hash:20060531154529-ac50b-92c8377b8b3164fa280c02b4752243295c4b7c40.gz
2006-06-01 01:45:29 +10:00
axel
2c44ecb4a3 Drop debug message
darcs-hash:20060531154456-ac50b-2367291f440bff21b3029829ff7dff86be5b5ec1.gz
2006-06-01 01:44:56 +10:00
axel
2eebb6e7ed Revert addition of the seq file to repo - only seq.in should be there. Also apply earlier fix to seq.in
darcs-hash:20060531154428-ac50b-7ddeef083d3d965eb484cb11a71c1291660fee89.gz
2006-06-01 01:44:28 +10:00
axel
1a3ab8a189 Make validation code show offening parameter on perameter expansion problems
darcs-hash:20060531154147-ac50b-dd9b9a3e000352b045a4a9c3122a45a312c43f19.gz
2006-06-01 01:41:47 +10:00
axel
4722ddc373 Increase size of buffer for parser error string. Should change this to a dynamically allocated string.
darcs-hash:20060531154028-ac50b-ada120ecfe65bcf1ad1b3d1a5fad41ae9dec133c.gz
2006-06-01 01:40:28 +10:00
axel
25365dbc54 Minor change to the strings to a printf comman, since it seems to work differently under different platforms
darcs-hash:20060530091417-ac50b-4eead9f39433b54ab66dea1c336b533689d85c46.gz
2006-05-30 19:14:17 +10:00
axel
6a5f11879b Minor code simplifications in highlighting code
darcs-hash:20060530003535-ac50b-6babcc9880a018a669e123c2acdb548adb4406ce.gz
2006-05-30 10:35:35 +10:00
axel
b028e41f7f Slightly updated fusermount completions - Thanks to Sean Higgins
darcs-hash:20060529135227-ac50b-ffce282fc850a895da75f64cd8a151277f42a937.gz
2006-05-29 23:52:27 +10:00
axel
86593cd6a2 Add highlighting to a few missing escape sequences
darcs-hash:20060529134659-ac50b-48de59c1c84e4e3d3a6cf6283ec8a652986c380d.gz
2006-05-29 23:46:59 +10:00
axel
6cae5c8b0a Minor rewordings and additions to the manual
darcs-hash:20060529134607-ac50b-097cf23e8009b13afa456cf3946cc0799b0fd471.gz
2006-05-29 23:46:07 +10:00
axel
29cd62ab6e Check documentation for listing of external commands instead of relying on out of date static lists in various places
darcs-hash:20060529133239-ac50b-48392cfa1e5817ed8df452f0632658af7fe47a28.gz
2006-05-29 23:32:39 +10:00
axel
4c7e06e752 Add missing event trigger when non-universal variable is erased
darcs-hash:20060529131217-ac50b-feb2034230297d9edc120369d8f3c1cfff6acfcd.gz
2006-05-29 23:12:17 +10:00
axel
433169dca4 Avoid using the pwd command in favour of the $PWD variable, since the pwd command does not seem to work well with fuse
darcs-hash:20060529130753-ac50b-0d32fe0924dbf9e83520d26402e9daae77789419.gz
2006-05-29 23:07:53 +10:00
axel
d46dade284 Rename function expand_variable_array to tokenize_variable_array and move it from expand.c to common.c, since it is used by fish_pager, which should not depend on expand.o
darcs-hash:20060529111342-ac50b-315d7dcf04e05fa8f32e16801e6793ac4e4e022e.gz
2006-05-29 21:13:42 +10:00
axel
79b466441b Fix major memory leak in highlighting code and a minor leak in the parser
darcs-hash:20060528110630-ac50b-94a83ec6731b39ebcf864b7491ec3c372e28a135.gz
2006-05-28 21:06:30 +10:00
axel
9f14d50974 Extend manual section on highlighting colors
darcs-hash:20060528105437-ac50b-c1c703206e855e5a4b5d7cf48bc19c48e12d2833.gz
2006-05-28 20:54:37 +10:00
axel
990803009e Minor edits
darcs-hash:20060527134918-ac50b-b244916fc6649e1abb4832bdaa3fff81fcbe3937.gz
2006-05-27 23:49:18 +10:00
axel
6dfd629fc5 Update todo list
darcs-hash:20060527134859-ac50b-3890023bb4003bbf773bf68dbcb9588c6ec55600.gz
2006-05-27 23:48:59 +10:00
axel
d97f8f3fde Add missing completion for complete builtin
darcs-hash:20060527134741-ac50b-dd50e408384d48b4b859240ac4fb6ad1ea8d25a5.gz
2006-05-27 23:47:41 +10:00
axel
95ca3d1c69 Minor clarifications for documentation for the set builtin
darcs-hash:20060527134723-ac50b-8ad44bf44a8537f12b45281950fcaf85abbdd8f4.gz
2006-05-27 23:47:23 +10:00
axel
c8b04f70cf Add highlighting of a few missing escapes
darcs-hash:20060527134026-ac50b-3ff05d1fe0246d37c1be6e4a6d4492bf411808b7.gz
2006-05-27 23:40:26 +10:00
axel
bffff77d17 Add support for bold highligting
darcs-hash:20060527133930-ac50b-515d0887567c0e89fdfe10fe8310d6ebb4485974.gz
2006-05-27 23:39:30 +10:00
axel
6bdb0cde8b Add support for highligting qutes in a special color - defaults to blue
darcs-hash:20060527123516-ac50b-d6e0cf08bd9dfe8514e64004d93dc4035e73fad8.gz
2006-05-27 22:35:16 +10:00
axel
42a260f1e6 Use ahead of time validator to make sure that commands entered on the command line are valid
darcs-hash:20060527111456-ac50b-1bc070467029b851d34a1b99457415e3f0b24429.gz
2006-05-27 21:14:56 +10:00
axel
148cb68700 Add Parenthesis and braces to list of highlighted operators, and do minor code cleanup
darcs-hash:20060527005618-ac50b-272d096796b732b7d6c000c30be1a9ca1e1995a6.gz
2006-05-27 10:56:18 +10:00
axel
18c185c256 Add support for highlighting operators and escaped sequences
darcs-hash:20060526164638-ac50b-2259579e0460df0641683ce6127bb8516fca8c7e.gz
2006-05-27 02:46:38 +10:00
axel
b5b49e7a4d Make sure that getopt flags are only written down once
darcs-hash:20060526145551-ac50b-5411809433e277cd0bdebc34907ee3312a8a0263.gz
2006-05-27 00:55:51 +10:00
axel
28ea5ce732 Add missing N_.fish file to repo
darcs-hash:20060526120906-ac50b-5c903a99dfcb176c454bec2abc25360e8a7bf79a.gz
2006-05-26 22:09:06 +10:00
axel
eccba7626d Properly exit ca_mode terminal mode on exit
darcs-hash:20060526120331-ac50b-bbddd181b0784072a47e0f852012b9588c4fc3d6.gz
2006-05-26 22:03:31 +10:00
axel
79d3207d51 The fallback seq implementation was missing in the darcs repo, add it and fix a bug in it
darcs-hash:20060526114722-ac50b-4b75ac32c6490b358bb1003736fdc47198f37030.gz
2006-05-26 21:47:22 +10:00
axel
d6bf879675 Move jobs builtin to its own file
darcs-hash:20060526113811-ac50b-9c0ed1aa26cd2f247978e406bea86e8c36d73710.gz
2006-05-26 21:38:11 +10:00
axel
051f557e8f Minor code polish for the validation code
darcs-hash:20060526112525-ac50b-d15f974d7abc5ffdc61273c1642c1cb711bc23fd.gz
2006-05-26 21:25:25 +10:00
axel
17171c3277 If a help page for a builtin is showed in response to an error, make sure it fits on screen, or only print the synopsis - this patch also contains a huge number of tweaks to where and when the help pages are printed
darcs-hash:20060526112402-ac50b-88993e45f411b2f1c45b3202c393c5328f1c7429.gz
2006-05-26 21:24:02 +10:00
axel
18a59291ed Bugfix for previous patch to simplify configuration checks for ulimit builtin
darcs-hash:20060526111934-ac50b-ae9e85cd3e18994d2c56c2f6c69df6a1d93f9ea6.gz
2006-05-26 21:19:34 +10:00
axel
29e86254d0 Allow tab completion of empty command names
darcs-hash:20060521223213-ac50b-5201b7f0dfe5227f93aae6db94450e165c9a5a34.gz
2006-05-22 08:32:13 +10:00
axel
b746a803a9 Add validator check to make sure the second argument to 'for' is 'in'
darcs-hash:20060521221604-ac50b-5bc4ce217a08304f68b97b20e908ea1279fe26e9.gz
2006-05-22 08:16:04 +10:00
axel
07e14ed7a8 Rewrite small amount of code in parameter expansion to use wide character strings, not narrow
darcs-hash:20060521214601-ac50b-bb3937f5abd2780a7ecf8ab13975a0f6b622323f.gz
2006-05-22 07:46:01 +10:00
axel
df5cc6f858 Fix bugs detected by the ahead-of-time syntax checking in the complete builtin
darcs-hash:20060521192705-ac50b-b4304328fb4b9cce853055a2f231c48050a17471.gz
2006-05-22 05:27:05 +10:00
axel
409a407ca0 Use ahead-of-time syntax checker to validate input for complete builtin
darcs-hash:20060521192630-ac50b-c469f5bb3bd2afddce3ffa80adba0589d515b938.gz
2006-05-22 05:26:30 +10:00
axel
1c2cbb00bc Major update to the ahead-of-time syntax checker
darcs-hash:20060521192524-ac50b-48713f826558e66ef21046d1bb779623cc2fd97a.gz
2006-05-22 05:25:24 +10:00
axel
bbf2a3836f Simplify code for detecting which macros are defined in sys/resource.h, no configure-time tests are needed
darcs-hash:20060519151443-ac50b-c87dba2175f5bf8d652c783559c3a9992247aa01.gz
2006-05-20 01:14:43 +10:00
axel
1aa1ab540e Bump version number
darcs-hash:20060519141037-ac50b-52155b56cfcd60f4a57787cd29ef8fa3f6348acc.gz
2006-05-20 00:10:37 +10:00
axel
27c9eb8758 Fix test suite
darcs-hash:20060519141023-ac50b-96cb2401e68ed0fa169c332c8efa8037a8482011.gz
2006-05-20 00:10:23 +10:00
axel
e6b1035ddc Spelling fixes - Thanks Netocrat!
darcs-hash:20060519140425-ac50b-e687924b06a7711b4e92930e239aea4b01076434.gz
2006-05-20 00:04:25 +10:00
axel
9f6aba38d6 Define WCHAR_MAX to INT_MAX, not 0x7fffffff if undefined, as per suggestion from Netocrat
darcs-hash:20060519095948-ac50b-19842d18f4a020da7895d21df2f289dcf42f30bf.gz
2006-05-19 19:59:48 +10:00
axel
b52fe0feb6 Minor edits to builtin_set.c
darcs-hash:20060519085813-ac50b-67b6772ac7723e13312e444944cc4b077ba23479.gz
2006-05-19 18:58:13 +10:00
axel
db459f869a Update the PATH checking code to work in batch mode
darcs-hash:20060518133726-ac50b-81759f01565fdfdb85c042c1db1b766a9a6adcda.gz
2006-05-18 23:37:26 +10:00
axel
763a6b8351 Minor cleanup
darcs-hash:20060518130039-ac50b-c17e794113c38909d90be840fce36c7727c628b4.gz
2006-05-18 23:00:39 +10:00
axel
4a06821d99 Make fish remove invalid PATH entries on startup, and give a warning about it
darcs-hash:20060518130017-ac50b-9326ed6b5671bbe0285fd2d5604e4ea69087c7c1.gz
2006-05-18 23:00:17 +10:00
axel
22f3dcfd35 Fix bug that causes fish to elongate the PATH whith directories which are already there
darcs-hash:20060518125909-ac50b-9c23915bb6f51f9105e04ad71b102b386b5d43a9.gz
2006-05-18 22:59:09 +10:00
axel
dbb66e1895 Remove two minor memory leaks
darcs-hash:20060514223903-ac50b-4e764c460effd8c45493acfe5682626c3711c77e.gz
2006-05-15 08:39:03 +10:00
axel
5a7a264b96 Fix bug that caused block level io redirection to break on while loops
darcs-hash:20060514222905-ac50b-7dec0ed716f5fe6af9069b597eee464829a8d820.gz
2006-05-15 08:29:05 +10:00
axel
3d601bd751 Remove superflous event_signal_listen function, replace all calls to it with event_get
darcs-hash:20060514222758-ac50b-de4457154510b89d1c9b893bc39f06a23c8fc08f.gz
2006-05-15 08:27:58 +10:00
axel
c9deea2237 Minor edits
darcs-hash:20060514163936-ac50b-2a208818ccb26dabb60fba18078c3824da40adf5.gz
2006-05-15 02:39:36 +10:00
axel
32e54fd719 Remove some hardcoded values in favour of constants
darcs-hash:20060514132510-ac50b-2c703e8892d04b7d74555d05eb6618140e281a61.gz
2006-05-14 23:25:10 +10:00
axel
9ebdc16be6 Fix the longstanding hang-on-exit bug in eterm, as well as making sure the history is saved when the terminal emulator exits
darcs-hash:20060514101623-ac50b-f8ce693ec111e3c158640ef8de309bf7e5484c5b.gz
2006-05-14 20:16:23 +10:00
axel
92ecc01baa Fix broken method for sorting output of builtin commands 'functions', 'set' and others
darcs-hash:20060514094721-ac50b-9f1d8b6a2e8b4438e6a655de61af54d15cd4f537.gz
2006-05-14 19:47:21 +10:00
axel
ff1c5e058f Fix output of the functions command, where a single function would sometimes be printed twice
darcs-hash:20060514094635-ac50b-0cb03011b667a2458c19619a04d46140834e637c.gz
2006-05-14 19:46:35 +10:00
axel
3d192a8e93 Remoce C99:ism (Non-constant expression as array size)
darcs-hash:20060512154447-ac50b-5731603e1bf75f91703bf79cc06f6bbdb94e6a61.gz
2006-05-13 01:44:47 +10:00
axel
f5c6306bde Do not repaint prompt on universal variable events, but add event handler for fish_color_cwd to repiant prompt on change
darcs-hash:20060511122629-ac50b-a725d87fe9ec911282e8de79aa9de5c00d180caa.gz
2006-05-11 22:26:29 +10:00
axel
524e0aa174 Add fallback del_curterm which does nothing, used in preference to BSD curses del_curterm, which seems to do a double-free
darcs-hash:20060511115846-ac50b-8d5fc054d31cff637d30e858ae8ffe2b1d1e8c03.gz
2006-05-11 21:58:46 +10:00
axel
94abb30f94 Do not try to read init files if the cd to the proper directory fails
darcs-hash:20060511115758-ac50b-94661cb36c5a55bc78ddfe576d1cd40fada5f065.gz
2006-05-11 21:57:58 +10:00
axel
af8e053896 Include stdint.h, in fallback.h, since WCHAR_MAX might be defined there and not in wchar.h, as the C standard says - Thanks to Peter Moulder for pointing this one out
darcs-hash:20060510132704-ac50b-9da156a6ee5f04e33fa8d5bf8cee581a88643cb2.gz
2006-05-10 23:27:04 +10:00
axel
633e2f498f Escape $ character in apropos completions - Thanks to Peter Moulder for pointing this one out
darcs-hash:20060510115641-ac50b-51db7d181d63119c6edc223b06f8b8b63e8149d6.gz
2006-05-10 21:56:41 +10:00
axel
4932538c74 Add a few NULL checks to the codebase to avoid crashes on minor bugs
darcs-hash:20060510115431-ac50b-f6b50fb29b95ff88e7504355aaffef1edcb6739d.gz
2006-05-10 21:54:31 +10:00
axel
786144ba86 Make sure tokenization errors in eval_args doesn't cause fish to crash while error reporting
darcs-hash:20060510115351-ac50b-57354a1a6f044504a16e294840d0092ebf98f600.gz
2006-05-10 21:53:51 +10:00
axel
e3dd94f272 Add missing quote escape to ls completions
darcs-hash:20060510115243-ac50b-6aff103edec7d1499702d5eb38d9841571d95c16.gz
2006-05-10 21:52:43 +10:00
axel
b110a0ae21 Allow backslash escape fur null byte
darcs-hash:20060509165501-ac50b-3a69a7ed0b96d5be7860aa997b7c77e37a6b1dc7.gz
2006-05-10 02:55:01 +10:00
axel
48d9c38d1e Fixed use of improper storage type for variable
darcs-hash:20060509165207-ac50b-48561332ab938fe7972bbf07f32ac1f92322d316.gz
2006-05-10 02:52:07 +10:00
axel
51f8272ebd Make sure WCHAR_MAX is defined (This is missing on OpenBSD for example)
darcs-hash:20060509164222-ac50b-595fd7507e2e5585b1a14e32792a38853b795b47.gz
2006-05-10 02:42:22 +10:00
axel
77f35c1b41 Add a little padding in the documentation stylesheet to make it easier to differ between different header levels
darcs-hash:20060509164146-ac50b-f165e89d3cf5d9a8db9826d804cd62b85bd6a3f7.gz
2006-05-10 02:41:46 +10:00
axel
06668bfacb Alter syntax for set builtin so that better slicing operations are possible
darcs-hash:20060509164055-ac50b-8514b73bb9e992c463966f95f783f01893ba93bd.gz
2006-05-10 02:40:55 +10:00
axel
df59b8498f Minor edits of function descriptions, includes, etc.
darcs-hash:20060502162950-ac50b-c2fcfc957d55f292744bcb4b33b4d66fc42087ed.gz
2006-05-03 02:29:50 +10:00
axel
92fde30c0c Fix segfault when using the 'set' command with no arguments
darcs-hash:20060502162830-ac50b-d3ab63c29a6daeaa62803923b060ec69942911f8.gz
2006-05-03 02:28:30 +10:00
axel
d690a15b29 Make job id numbering start from 1, not 0
darcs-hash:20060428132137-ac50b-8e5adcdbc18ad7627b66e9129a13b037a669dd02.gz
2006-04-28 23:21:37 +10:00
axel
445f6539cf Fix two bugs in the jobs builtin, causing freezes and other incorrect behaviours
darcs-hash:20060424153434-ac50b-2434329395cbd4a258d6fb9f15e166065b2eb164.gz
2006-04-25 01:34:34 +10:00
axel
13a7269378 Bump version number
darcs-hash:20060422101024-ac50b-8cfc71d94572187d8d3a6ce890beee0a0225a09a.gz
2006-04-22 20:10:24 +10:00
axel
fd2644ce49 Tweaks to a few error messages (Thanks to Philip Ganchev)
darcs-hash:20060422100630-ac50b-18cef1e493321e8ad0cf65982dc1748965d02630.gz
2006-04-22 20:06:30 +10:00
axel
508de57459 Change setup to avoid invalid directories and warnings, also revert directory checking for fish_*_path, it makes sense to add non-empty directories to these
darcs-hash:20060421150558-ac50b-90aff08f81b3d280badba4cc14fb6a0897c39f9e.gz
2006-04-22 01:05:58 +10:00
axel
de2405b35a Add more descriptive error messages when trying to use variables in command names
darcs-hash:20060421142939-ac50b-d1809fa4687706b433d1d0a5e0a0c9d791de510f.gz
2006-04-22 00:29:39 +10:00
axel
a7f977836a Expand the switch/case documentation
darcs-hash:20060421083529-ac50b-f287424c0cc9377085b49492453d35a5512cbc90.gz
2006-04-21 18:35:29 +10:00
axel
f59e4a88c6 If PATH is unset, use a default value
darcs-hash:20060420183502-ac50b-8e746ae4ed00c354712cf61e57e0a187aa40a4fa.gz
2006-04-21 04:35:02 +10:00
axel
c755bd0358 Only allow real directories in PATH, CDPATH, etc. If user tries to use ':' instead of arrays, give a friendly pointer on how to use arrays
darcs-hash:20060420182944-ac50b-fbb5dc63c2a4d3fe3bde92ad7699b1cad972dd0f.gz
2006-04-21 04:29:44 +10:00
axel
536523ffd7 Minor comment and documentation edits
darcs-hash:20060420150206-ac50b-c5c91053ee37a6c3f763287c42b430cdc99bb45b.gz
2006-04-21 01:02:06 +10:00
axel
ca82fc2f03 Add missing documentation for the read builtin
darcs-hash:20060420150124-ac50b-71a94cea3fedb0265af71718022e54e42567d69e.gz
2006-04-21 01:01:24 +10:00
axel
d1411c42d6 Minor edits to Makefile. A mistyped .PHONY was corrected, a few stray .o files are now properly removed by make clean, and the dependency list has been updated
darcs-hash:20060420150028-ac50b-b3b6b04023f1c039d167e5f67c89cbbaa6bd0cdc.gz
2006-04-21 01:00:28 +10:00
axel
9d770af5f4 Earlier history in non-interactive mode bugfix contained a new bug causing fish to crash if read is not used in non-interactive mode
darcs-hash:20060419234211-ac50b-886a33e96cb3f95e9b2c632f03eb3b2b20a560fd.gz
2006-04-20 09:42:11 +10:00
axel
d1ff6a323a Bump version number
darcs-hash:20060419124513-ac50b-f0c4bacee786ca9e147a86004aa90f5a09c04b34.gz
2006-04-19 22:45:13 +10:00
axel
112ea1759a Minor code cleanup
darcs-hash:20060419124315-ac50b-e7e9cafe6850e1fe805bad82278d15c2de327f5d.gz
2006-04-19 22:43:15 +10:00
axel
76bafbef2a Make the read builtin accept 0 parameters and drop the input instead of showing an error message
darcs-hash:20060419100830-ac50b-50f96925481bb29ad840fb12240ef9b9b86d18c4.gz
2006-04-19 20:08:30 +10:00
axel
1947ec88f1 Remove minor memory leak on init
darcs-hash:20060419095818-ac50b-d2146525feba5f00d224bce920ab40cc023e390d.gz
2006-04-19 19:58:18 +10:00
axel
d0956f1e43 Use libc implementations of wcslcpy and wcslcat if they exist. Move internal implementations to fallback.c.
darcs-hash:20060419095628-ac50b-0e94e4205306bb99bb9dea72eec43b442520bf1b.gz
2006-04-19 19:56:28 +10:00
axel
6996c7718e Always init history on startup, to avoid destorying history multiple times when reading interactively in a non-interactive script
darcs-hash:20060419095502-ac50b-abf2fe39cf9c027bdbc69d78fe858e946f7c81f2.gz
2006-04-19 19:55:02 +10:00
axel
45d56d8e05 Drop all calls to wcsncpy
darcs-hash:20060413121851-ac50b-1f479b96b3aa1050a30e9ee0ed27cc107ce2bc45.gz
2006-04-13 22:18:51 +10:00
axel
53295d38b7 Change var_entry_t struct to be ANSI C compliant (Wastes a few hundred bytes)
darcs-hash:20060410160109-ac50b-fa8b097722f06aee5fb09095e89f6b39ff90d44b.gz
2006-04-11 02:01:09 +10:00
axel
bd9c843fd1 Add warning when trying to change read-only variable
darcs-hash:20060410153626-ac50b-700ff7687647b8aab47ba79d759d1739cbe60425.gz
2006-04-11 01:36:26 +10:00
axel
f812b9b26c Fix bug in type command causing type -f to return true even when no file was found
darcs-hash:20060410143201-ac50b-4d8a70cd9721edcddaf11324f0b575d3f8cbace8.gz
2006-04-11 00:32:01 +10:00
axel
52851a3ba4 Quote Doxygen test in configure script to remove warning - thanks to Ray Hammond for the report and the fix
darcs-hash:20060410141909-ac50b-f310b7e326ce28ae8a3bbc1a3c1d247511f3d860.gz
2006-04-11 00:19:09 +10:00
axel
b1bf115fa2 Bump version number
darcs-hash:20060408143210-ac50b-0a143a45d0510e67a75024b802a1ca677480e4c0.gz
2006-04-09 00:32:10 +10:00
axel
0f25ef365d Tiny documentation edits
darcs-hash:20060408143134-ac50b-eae8cf585d3801b51bba415955ef2aacf98baeb2.gz
2006-04-09 00:31:34 +10:00
axel
55ea4b6fc0 Documentation additions
darcs-hash:20060405132928-ac50b-d551c31d04426c75c756d513e02e34b91bfc4ad6.gz
2006-04-05 23:29:28 +10:00
axel
5ef8cccf21 Mention in the license section that fish includes the glibc wcstok implementation as a fallback for libc implementations lacking wcstok
darcs-hash:20060405125956-ac50b-9e5b51d94676868365878387cd8c7e14a1684348.gz
2006-04-05 22:59:56 +10:00
axel
5613d96001 Do not call autoconf in Makefile, since configure will automatically reconfigure itself if configure.ac has changed
darcs-hash:20060405124918-ac50b-0f45ddc7759383d930e0473a281f092566570210.gz
2006-04-05 22:49:18 +10:00
axel
5d9ba8c1a2 Delete some commented code and tweak a few comments
darcs-hash:20060405124825-ac50b-8242b2a9c788cf147f864329797b2e24a7040f0b.gz
2006-04-05 22:48:25 +10:00
axel
0de232bf54 Do not return to the shell until all processes of a job have finished (Previous behaviour was to return once the last job had exited, and could cause e.g. the jobs builtin to print out the job responsible for repainting the titlebar). Also validate that jobs have not completed in various places where the job list is examined
darcs-hash:20060404112722-ac50b-4b6a55ce7c57d39213cdd0ed0f581795a72859b7.gz
2006-04-04 21:27:22 +10:00
axel
db5b887824 PPC fix by James Vega, fixing an issue with a variable named putc, which clashed with the putc macro
darcs-hash:20060403150422-ac50b-78d5db541cb1f41bfea55deac7578c0df73605bd.gz
2006-04-04 01:04:22 +10:00
594 changed files with 105945 additions and 47175 deletions

4
.gitattributes vendored Normal file
View File

@@ -0,0 +1,4 @@
.gitattributes export-ignore
.gitignore export-ignore
/build_tools export-ignore

33
.gitignore vendored Normal file
View File

@@ -0,0 +1,33 @@
*.o
*~
Doxyfile.help
Makefile
autom4te.cache/
command_list.txt
config.h
config.h.in
config.log
config.status
configure
doc.h
doc_src/commands.hdr
doc_src/index.hdr
etc/config.fish
po/*.gmo
fish
fish.spec
fish_indent
fish_pager
fish_tests
fishd
mimedb
seq
set_color
share/config.fish
share/man/
toc.txt
user_doc/
xsel-1.2.0/
tests/*tmp.*
tests/foo.txt

3
CHANGELOG Normal file
View File

@@ -0,0 +1,3 @@
24-01-2012 Jan Kanis
* Added a changelog file
* removed unescaping if the 'commandline' builtin is called without the -o (tokenise) flag

939
Doxyfile

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -10,8 +10,8 @@ ABBREVIATE_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
@@ -19,7 +19,7 @@ DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ALIASES =
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
@@ -44,7 +44,7 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
@@ -53,19 +53,19 @@ WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
INPUT =
WARN_LOGFILE =
INPUT =
FILE_PATTERNS = doc.h
RECURSIVE = NO
EXCLUDE =
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
@@ -75,17 +75,17 @@ REFERENCES_RELATION = YES
VERBATIM_HEADERS = YES
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER = user_doc.head.html
HTML_FOOTER =
HTML_STYLESHEET =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
@@ -93,14 +93,14 @@ DISABLE_INDEX = YES
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
GENERATE_LATEX = YES
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
@@ -109,33 +109,33 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
TAGFILES =
GENERATE_TAGFILE =
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
@@ -151,8 +151,8 @@ INCLUDED_BY_GRAPH = YES
CALL_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 750
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 0

View File

@@ -0,0 +1,356 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXFileReference section */
D03EE83814DF88B200FC7150 /* lru.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lru.h; sourceTree = "<group>"; };
D09B1C1914FC7B5B00F91077 /* postfork.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = postfork.cpp; sourceTree = "<group>"; };
D09B1C1A14FC7B5B00F91077 /* postfork.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = postfork.h; sourceTree = "<group>"; };
D0A0850313B3ACEE0099B651 /* builtin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = builtin.h; sourceTree = "<group>"; };
D0A0850413B3ACEE0099B651 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
D0A0850513B3ACEE0099B651 /* complete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = complete.h; sourceTree = "<group>"; };
D0A0850613B3ACEE0099B651 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
D0A0850713B3ACEE0099B651 /* env_universal_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = env_universal_common.h; sourceTree = "<group>"; };
D0A0850813B3ACEE0099B651 /* env_universal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = env_universal.h; sourceTree = "<group>"; };
D0A0850913B3ACEE0099B651 /* env.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = env.h; sourceTree = "<group>"; };
D0A0850A13B3ACEE0099B651 /* event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = event.h; sourceTree = "<group>"; };
D0A0850B13B3ACEE0099B651 /* exec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exec.h; sourceTree = "<group>"; };
D0A0850C13B3ACEE0099B651 /* expand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = expand.h; sourceTree = "<group>"; };
D0A0850D13B3ACEE0099B651 /* fallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fallback.h; sourceTree = "<group>"; };
D0A0850E13B3ACEE0099B651 /* function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = function.h; sourceTree = "<group>"; };
D0A0851113B3ACEE0099B651 /* highlight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = highlight.h; sourceTree = "<group>"; };
D0A0851213B3ACEE0099B651 /* history.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = history.h; sourceTree = "<group>"; };
D0A0851313B3ACEE0099B651 /* input_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = input_common.h; sourceTree = "<group>"; };
D0A0851413B3ACEE0099B651 /* input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = input.h; sourceTree = "<group>"; };
D0A0851513B3ACEE0099B651 /* intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = intern.h; sourceTree = "<group>"; };
D0A0851613B3ACEE0099B651 /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io.h; sourceTree = "<group>"; };
D0A0851713B3ACEE0099B651 /* iothread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iothread.h; sourceTree = "<group>"; };
D0A0851813B3ACEE0099B651 /* kill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kill.h; sourceTree = "<group>"; };
D0A0851913B3ACEE0099B651 /* mimedb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mimedb.h; sourceTree = "<group>"; };
D0A0851A13B3ACEE0099B651 /* output.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = output.h; sourceTree = "<group>"; };
D0A0851B13B3ACEE0099B651 /* parse_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse_util.h; sourceTree = "<group>"; };
D0A0851C13B3ACEE0099B651 /* parser_keywords.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser_keywords.h; sourceTree = "<group>"; };
D0A0851D13B3ACEE0099B651 /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = "<group>"; };
D0A0851E13B3ACEE0099B651 /* path.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = path.h; sourceTree = "<group>"; };
D0A0851F13B3ACEE0099B651 /* print_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = print_help.h; sourceTree = "<group>"; };
D0A0852013B3ACEE0099B651 /* proc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = proc.h; sourceTree = "<group>"; };
D0A0852113B3ACEE0099B651 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; };
D0A0852213B3ACEE0099B651 /* sanity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sanity.h; sourceTree = "<group>"; };
D0A0852313B3ACEE0099B651 /* screen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = screen.h; sourceTree = "<group>"; };
D0A0852413B3ACEE0099B651 /* signal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = signal.h; sourceTree = "<group>"; };
D0A0852513B3ACEE0099B651 /* tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tokenizer.h; sourceTree = "<group>"; };
D0A0852613B3ACEE0099B651 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = "<group>"; };
D0A0852713B3ACEE0099B651 /* wgetopt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wgetopt.h; sourceTree = "<group>"; };
D0A0852813B3ACEE0099B651 /* wildcard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wildcard.h; sourceTree = "<group>"; };
D0A0852913B3ACEE0099B651 /* wutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wutil.h; sourceTree = "<group>"; };
D0A0852A13B3ACEE0099B651 /* xdgmime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmime.h; sourceTree = "<group>"; };
D0A0852B13B3ACEE0099B651 /* xdgmimealias.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimealias.h; sourceTree = "<group>"; };
D0A0852C13B3ACEE0099B651 /* xdgmimeglob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimeglob.h; sourceTree = "<group>"; };
D0A0852D13B3ACEE0099B651 /* xdgmimeint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimeint.h; sourceTree = "<group>"; };
D0A0852E13B3ACEE0099B651 /* xdgmimemagic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimemagic.h; sourceTree = "<group>"; };
D0A0852F13B3ACEE0099B651 /* xdgmimeparent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimeparent.h; sourceTree = "<group>"; };
D0A0853013B3ACEE0099B651 /* builtin_commandline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_commandline.cpp; sourceTree = "<group>"; };
D0A0853113B3ACEE0099B651 /* builtin_complete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_complete.cpp; sourceTree = "<group>"; };
D0A0853213B3ACEE0099B651 /* builtin_jobs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_jobs.cpp; sourceTree = "<group>"; };
D0A0853313B3ACEE0099B651 /* builtin_set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_set.cpp; sourceTree = "<group>"; };
D0A0853413B3ACEE0099B651 /* builtin_ulimit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_ulimit.cpp; sourceTree = "<group>"; };
D0A0853513B3ACEE0099B651 /* builtin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin.cpp; sourceTree = "<group>"; };
D0A0853613B3ACEE0099B651 /* common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = common.cpp; sourceTree = "<group>"; };
D0A0853713B3ACEE0099B651 /* complete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = complete.cpp; sourceTree = "<group>"; };
D0A0853813B3ACEE0099B651 /* env_universal_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = env_universal_common.cpp; sourceTree = "<group>"; };
D0A0853913B3ACEE0099B651 /* env_universal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = env_universal.cpp; sourceTree = "<group>"; };
D0A0853A13B3ACEE0099B651 /* env.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = env.cpp; sourceTree = "<group>"; };
D0A0853B13B3ACEE0099B651 /* event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = event.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
D0A0853C13B3ACEE0099B651 /* exec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exec.cpp; sourceTree = "<group>"; };
D0A0853D13B3ACEE0099B651 /* expand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = expand.cpp; sourceTree = "<group>"; };
D0A0853E13B3ACEE0099B651 /* fallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fallback.cpp; sourceTree = "<group>"; };
D0A0853F13B3ACEE0099B651 /* fish_indent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish_indent.cpp; sourceTree = "<group>"; };
D0A0854013B3ACEE0099B651 /* fish_pager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish_pager.cpp; sourceTree = "<group>"; };
D0A0854113B3ACEE0099B651 /* fish_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish_tests.cpp; sourceTree = "<group>"; };
D0A0854213B3ACEE0099B651 /* fish.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish.cpp; sourceTree = "<group>"; };
D0A0854313B3ACEE0099B651 /* fishd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fishd.cpp; sourceTree = "<group>"; };
D0A0854413B3ACEE0099B651 /* function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = function.cpp; sourceTree = "<group>"; };
D0A0854713B3ACEE0099B651 /* highlight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = highlight.cpp; sourceTree = "<group>"; };
D0A0854813B3ACEE0099B651 /* history.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = history.cpp; sourceTree = "<group>"; };
D0A0854913B3ACEE0099B651 /* input_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = input_common.cpp; sourceTree = "<group>"; };
D0A0854A13B3ACEE0099B651 /* input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = input.cpp; sourceTree = "<group>"; };
D0A0854B13B3ACEE0099B651 /* intern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = intern.cpp; sourceTree = "<group>"; };
D0A0854C13B3ACEE0099B651 /* io.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = io.cpp; sourceTree = "<group>"; };
D0A0854D13B3ACEE0099B651 /* iothread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iothread.cpp; sourceTree = "<group>"; };
D0A0854E13B3ACEE0099B651 /* key_reader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = key_reader.cpp; sourceTree = "<group>"; };
D0A0854F13B3ACEE0099B651 /* kill.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kill.cpp; sourceTree = "<group>"; };
D0A0855013B3ACEE0099B651 /* mimedb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mimedb.cpp; sourceTree = "<group>"; };
D0A0855113B3ACEE0099B651 /* output.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = output.cpp; sourceTree = "<group>"; };
D0A0855213B3ACEE0099B651 /* parse_util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parse_util.cpp; sourceTree = "<group>"; };
D0A0855313B3ACEE0099B651 /* parser_keywords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_keywords.cpp; sourceTree = "<group>"; };
D0A0855413B3ACEE0099B651 /* parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = parser.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
D0A0855513B3ACEE0099B651 /* path.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = path.cpp; sourceTree = "<group>"; };
D0A0855613B3ACEE0099B651 /* print_help.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = print_help.cpp; sourceTree = "<group>"; };
D0A0855713B3ACEE0099B651 /* proc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = proc.cpp; sourceTree = "<group>"; };
D0A0855813B3ACEE0099B651 /* reader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = reader.cpp; sourceTree = "<group>"; };
D0A0855913B3ACEE0099B651 /* sanity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sanity.cpp; sourceTree = "<group>"; };
D0A0855A13B3ACEE0099B651 /* screen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = screen.cpp; sourceTree = "<group>"; };
D0A0855B13B3ACEE0099B651 /* set_color.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = set_color.cpp; sourceTree = "<group>"; };
D0A0855C13B3ACEE0099B651 /* signal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = signal.cpp; sourceTree = "<group>"; };
D0A0855D13B3ACEE0099B651 /* tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tokenizer.cpp; sourceTree = "<group>"; };
D0A0855E13B3ACEE0099B651 /* util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util.cpp; sourceTree = "<group>"; };
D0A0855F13B3ACEE0099B651 /* wgetopt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wgetopt.cpp; sourceTree = "<group>"; };
D0A0856013B3ACEE0099B651 /* wildcard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wildcard.cpp; sourceTree = "<group>"; };
D0A0856113B3ACEE0099B651 /* wutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wutil.cpp; sourceTree = "<group>"; };
D0A0856213B3ACEE0099B651 /* xdgmime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmime.cpp; sourceTree = "<group>"; };
D0A0856313B3ACEE0099B651 /* xdgmimealias.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimealias.cpp; sourceTree = "<group>"; };
D0A0856413B3ACEE0099B651 /* xdgmimeglob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimeglob.cpp; sourceTree = "<group>"; };
D0A0856513B3ACEE0099B651 /* xdgmimeint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimeint.cpp; sourceTree = "<group>"; };
D0A0856613B3ACEE0099B651 /* xdgmimemagic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimemagic.cpp; sourceTree = "<group>"; };
D0A0856713B3ACEE0099B651 /* xdgmimeparent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimeparent.cpp; sourceTree = "<group>"; };
D0B6B0FE14E88BA400AD6C10 /* color.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = color.cpp; sourceTree = "<group>"; };
D0B6B0FF14E88BA400AD6C10 /* color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = color.h; sourceTree = "<group>"; };
D0C6FCC914CFA4B0004CE8AD /* autoload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = autoload.cpp; sourceTree = "<group>"; };
D0C6FCCB14CFA4B7004CE8AD /* autoload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = autoload.h; sourceTree = "<group>"; };
D0F3373A1506DE3C00ECEFC0 /* builtin_test.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_test.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
D0A084F013B3AC130099B651 = {
isa = PBXGroup;
children = (
D0C6FCCB14CFA4B7004CE8AD /* autoload.h */,
D0C6FCC914CFA4B0004CE8AD /* autoload.cpp */,
D0A0850313B3ACEE0099B651 /* builtin.h */,
D0A0853013B3ACEE0099B651 /* builtin_commandline.cpp */,
D0A0853113B3ACEE0099B651 /* builtin_complete.cpp */,
D0A0853213B3ACEE0099B651 /* builtin_jobs.cpp */,
D0A0853313B3ACEE0099B651 /* builtin_set.cpp */,
D0A0853413B3ACEE0099B651 /* builtin_ulimit.cpp */,
D0F3373A1506DE3C00ECEFC0 /* builtin_test.cpp */,
D0A0853513B3ACEE0099B651 /* builtin.cpp */,
D0B6B0FF14E88BA400AD6C10 /* color.h */,
D0B6B0FE14E88BA400AD6C10 /* color.cpp */,
D0A0850413B3ACEE0099B651 /* common.h */,
D0A0853613B3ACEE0099B651 /* common.cpp */,
D0A0850513B3ACEE0099B651 /* complete.h */,
D0A0853713B3ACEE0099B651 /* complete.cpp */,
D0A0850613B3ACEE0099B651 /* config.h */,
D0A0850713B3ACEE0099B651 /* env_universal_common.h */,
D0A0853813B3ACEE0099B651 /* env_universal_common.cpp */,
D0A0850813B3ACEE0099B651 /* env_universal.h */,
D0A0853913B3ACEE0099B651 /* env_universal.cpp */,
D0A0850913B3ACEE0099B651 /* env.h */,
D0A0853A13B3ACEE0099B651 /* env.cpp */,
D0A0850A13B3ACEE0099B651 /* event.h */,
D0A0853B13B3ACEE0099B651 /* event.cpp */,
D0A0850B13B3ACEE0099B651 /* exec.h */,
D0A0853C13B3ACEE0099B651 /* exec.cpp */,
D0A0850C13B3ACEE0099B651 /* expand.h */,
D0A0853D13B3ACEE0099B651 /* expand.cpp */,
D0A0850D13B3ACEE0099B651 /* fallback.h */,
D0A0853E13B3ACEE0099B651 /* fallback.cpp */,
D0A0850E13B3ACEE0099B651 /* function.h */,
D0A0854413B3ACEE0099B651 /* function.cpp */,
D0A0853F13B3ACEE0099B651 /* fish_indent.cpp */,
D0A0854013B3ACEE0099B651 /* fish_pager.cpp */,
D0A0854113B3ACEE0099B651 /* fish_tests.cpp */,
D0A0854213B3ACEE0099B651 /* fish.cpp */,
D0A0854313B3ACEE0099B651 /* fishd.cpp */,
D0A0851113B3ACEE0099B651 /* highlight.h */,
D0A0854713B3ACEE0099B651 /* highlight.cpp */,
D0A0851213B3ACEE0099B651 /* history.h */,
D0A0854813B3ACEE0099B651 /* history.cpp */,
D0A0851313B3ACEE0099B651 /* input_common.h */,
D0A0854913B3ACEE0099B651 /* input_common.cpp */,
D0A0851413B3ACEE0099B651 /* input.h */,
D0A0854A13B3ACEE0099B651 /* input.cpp */,
D0A0851513B3ACEE0099B651 /* intern.h */,
D0A0854B13B3ACEE0099B651 /* intern.cpp */,
D0A0851613B3ACEE0099B651 /* io.h */,
D0A0854C13B3ACEE0099B651 /* io.cpp */,
D0A0851713B3ACEE0099B651 /* iothread.h */,
D0A0854D13B3ACEE0099B651 /* iothread.cpp */,
D0A0851813B3ACEE0099B651 /* kill.h */,
D0A0854F13B3ACEE0099B651 /* kill.cpp */,
D0A0854E13B3ACEE0099B651 /* key_reader.cpp */,
D03EE83814DF88B200FC7150 /* lru.h */,
D0A0851913B3ACEE0099B651 /* mimedb.h */,
D0A0855013B3ACEE0099B651 /* mimedb.cpp */,
D0A0851A13B3ACEE0099B651 /* output.h */,
D0A0855113B3ACEE0099B651 /* output.cpp */,
D0A0851B13B3ACEE0099B651 /* parse_util.h */,
D0A0855213B3ACEE0099B651 /* parse_util.cpp */,
D0A0851C13B3ACEE0099B651 /* parser_keywords.h */,
D0A0855313B3ACEE0099B651 /* parser_keywords.cpp */,
D0A0851D13B3ACEE0099B651 /* parser.h */,
D0A0855413B3ACEE0099B651 /* parser.cpp */,
D0A0851E13B3ACEE0099B651 /* path.h */,
D0A0855513B3ACEE0099B651 /* path.cpp */,
D09B1C1A14FC7B5B00F91077 /* postfork.h */,
D09B1C1914FC7B5B00F91077 /* postfork.cpp */,
D0A0851F13B3ACEE0099B651 /* print_help.h */,
D0A0855613B3ACEE0099B651 /* print_help.cpp */,
D0A0852013B3ACEE0099B651 /* proc.h */,
D0A0855713B3ACEE0099B651 /* proc.cpp */,
D0A0852113B3ACEE0099B651 /* reader.h */,
D0A0855813B3ACEE0099B651 /* reader.cpp */,
D0A0852213B3ACEE0099B651 /* sanity.h */,
D0A0855913B3ACEE0099B651 /* sanity.cpp */,
D0A0852313B3ACEE0099B651 /* screen.h */,
D0A0855A13B3ACEE0099B651 /* screen.cpp */,
D0A0852413B3ACEE0099B651 /* signal.h */,
D0A0855C13B3ACEE0099B651 /* signal.cpp */,
D0A0855B13B3ACEE0099B651 /* set_color.cpp */,
D0A0852513B3ACEE0099B651 /* tokenizer.h */,
D0A0855D13B3ACEE0099B651 /* tokenizer.cpp */,
D0A0852613B3ACEE0099B651 /* util.h */,
D0A0855E13B3ACEE0099B651 /* util.cpp */,
D0A0852713B3ACEE0099B651 /* wgetopt.h */,
D0A0855F13B3ACEE0099B651 /* wgetopt.cpp */,
D0A0852813B3ACEE0099B651 /* wildcard.h */,
D0A0856013B3ACEE0099B651 /* wildcard.cpp */,
D0A0852913B3ACEE0099B651 /* wutil.h */,
D0A0856113B3ACEE0099B651 /* wutil.cpp */,
D0A0852A13B3ACEE0099B651 /* xdgmime.h */,
D0A0856213B3ACEE0099B651 /* xdgmime.cpp */,
D0A0852B13B3ACEE0099B651 /* xdgmimealias.h */,
D0A0856313B3ACEE0099B651 /* xdgmimealias.cpp */,
D0A0852C13B3ACEE0099B651 /* xdgmimeglob.h */,
D0A0856413B3ACEE0099B651 /* xdgmimeglob.cpp */,
D0A0852D13B3ACEE0099B651 /* xdgmimeint.h */,
D0A0856513B3ACEE0099B651 /* xdgmimeint.cpp */,
D0A0852E13B3ACEE0099B651 /* xdgmimemagic.h */,
D0A0856613B3ACEE0099B651 /* xdgmimemagic.cpp */,
D0A0852F13B3ACEE0099B651 /* xdgmimeparent.h */,
D0A0856713B3ACEE0099B651 /* xdgmimeparent.cpp */,
);
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXLegacyTarget section */
D0A084F713B3AC130099B651 /* FishsFish */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "-k ${ACTION}";
buildConfigurationList = D0A084FA13B3AC130099B651 /* Build configuration list for PBXLegacyTarget "FishsFish" */;
buildPhases = (
);
buildToolPath = /usr/bin/make;
buildWorkingDirectory = "";
dependencies = (
);
name = FishsFish;
passBuildSettingsInEnvironment = 1;
productName = FishsFish;
};
/* End PBXLegacyTarget section */
/* Begin PBXProject section */
D0A084F213B3AC130099B651 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = D0A084F513B3AC130099B651 /* Build configuration list for PBXProject "FishsFish" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = D0A084F013B3AC130099B651;
projectDirPath = "";
projectRoot = "";
targets = (
D0A084F713B3AC130099B651 /* FishsFish */,
);
};
/* End PBXProject section */
/* Begin XCBuildConfiguration section */
D0A084F813B3AC130099B651 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
D0A084F913B3AC130099B651 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
SDKROOT = macosx;
};
name = Release;
};
D0A084FB13B3AC130099B651 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
DEBUGGING_SYMBOLS = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
D0A084FC13B3AC130099B651 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
D0A084F513B3AC130099B651 /* Build configuration list for PBXProject "FishsFish" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D0A084F813B3AC130099B651 /* Debug */,
D0A084F913B3AC130099B651 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D0A084FA13B3AC130099B651 /* Build configuration list for PBXLegacyTarget "FishsFish" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D0A084FB13B3AC130099B651 /* Debug */,
D0A084FC13B3AC130099B651 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D0A084F213B3AC130099B651 /* Project object */;
}

25
INSTALL
View File

@@ -32,19 +32,24 @@ separate build directories or any other fancy configure options.
Simple install procedure
========================
If you have downloaded the darcs repository of fish, you need to run
the autoconf command first. Then use the following commands to compile
fish:
Always begin by uninstalling any previous fish versions. This is done
by running the command 'make uninstall' in the source directory of
your previous fish installation.
% ./configure
% make # Compile fish
% make install # Install fish
% echo /usr/local/bin/fish >>/etc/shells # Add fish to list of shells
Next, if you have downloaded a fresh copy of the darcs repository of
fish, you need to run the 'autoconf' command.
If you wish to use fish as your default shell, use the following
command:
Then, use following commands to compile fish:
% chsh -s /usr/local/bin/fish
./configure
make # Compile fish
make install # Install fish
echo /usr/local/bin/fish >>/etc/shells # Add fish to list of shells
Finally, if you wish to use fish as your default shell, use the
following command:
% chsh -s /usr/local/bin/fish
chsh will prompt you for your password, and change your default shell.

File diff suppressed because it is too large Load Diff

341
autoload.cpp Normal file
View File

@@ -0,0 +1,341 @@
/** \file autoload.cpp
The classes responsible for autoloading functions and completions.
*/
#include "config.h"
#include "autoload.h"
#include "wutil.h"
#include "common.h"
#include "signal.h"
#include "env.h"
#include "builtin_scripts.h"
#include "exec.h"
#include <assert.h>
#include <algorithm>
/* The time before we'll recheck an autoloaded file */
static const int kAutoloadStalenessInterval = 15;
file_access_attempt_t access_file(const wcstring &path, int mode) {
file_access_attempt_t result = {0};
struct stat statbuf;
if (wstat(path, &statbuf)) {
result.error = errno;
} else {
result.mod_time = statbuf.st_mtime;
if (waccess(path, mode)) {
result.error = errno;
} else {
result.accessible = true;
}
}
// Note that we record the last checked time after the call, on the assumption that in a slow filesystem, the lag comes before the kernel check, not after.
result.stale = false;
result.last_checked = time(NULL);
return result;
}
autoload_t::autoload_t(const wcstring &env_var_name_var, const builtin_script_t * const scripts, size_t script_count) :
env_var_name(env_var_name_var),
builtin_scripts(scripts),
builtin_script_count(script_count)
{
pthread_mutex_init(&lock, NULL);
}
autoload_t::~autoload_t() {
pthread_mutex_destroy(&lock);
}
void autoload_t::node_was_evicted(autoload_function_t *node) {
// This should only ever happen on the main thread
ASSERT_IS_MAIN_THREAD();
// Tell ourselves that the command was removed if it was loaded
if (! node->is_loaded)
this->command_removed(node->key);
delete node;
}
int autoload_t::unload( const wcstring &cmd )
{
return this->evict_node(cmd);
}
int autoload_t::load( const wcstring &cmd, bool reload )
{
int res;
CHECK_BLOCK( 0 );
ASSERT_IS_MAIN_THREAD();
env_var_t path_var = env_get_string( env_var_name );
/*
Do we know where to look?
*/
if( path_var.empty() )
return 0;
/* Check if the lookup path has changed. If so, drop all loaded files. path_var may only be inspected on the main thread. */
if( path_var != this->last_path )
{
this->last_path = path_var;
scoped_lock locker(lock);
this->evict_all_nodes();
}
/** Warn and fail on infinite recursion. It's OK to do this because this function is only called on the main thread. */
if (this->is_loading(cmd))
{
debug( 0,
_( L"Could not autoload item '%ls', it is already being autoloaded. "
L"This is a circular dependency in the autoloading scripts, please remove it."),
cmd.c_str() );
return 1;
}
/* Mark that we're loading this */
is_loading_set.insert(cmd);
/* Get the list of paths from which we will try to load */
std::vector<wcstring> path_list;
tokenize_variable_array( path_var, path_list );
/* Try loading it */
res = this->locate_file_and_maybe_load_it( cmd, true, reload, path_list );
/* Clean up */
int erased = is_loading_set.erase(cmd);
assert(erased);
return res;
}
bool autoload_t::can_load( const wcstring &cmd, const env_vars &vars )
{
const wchar_t *path_var_ptr = vars.get(env_var_name.c_str());
if (! path_var_ptr || ! path_var_ptr[0])
return false;
const wcstring path_var(path_var_ptr);
std::vector<wcstring> path_list;
tokenize_variable_array( path_var, path_list );
return this->locate_file_and_maybe_load_it( cmd, false, false, path_list );
}
static bool script_name_precedes_script_name(const builtin_script_t &script1, const builtin_script_t &script2)
{
return wcscmp(script1.name, script2.name) < 0;
}
void autoload_t::unload_all(void) {
scoped_lock locker(lock);
this->evict_all_nodes();
}
/** Check whether the given command is loaded. */
bool autoload_t::has_tried_loading( const wcstring &cmd )
{
scoped_lock locker(lock);
autoload_function_t * func = this->get_node(cmd);
return func != NULL;
}
static bool is_stale(const autoload_function_t *func) {
/** Return whether this function is stale. Internalized functions can never be stale. */
return ! func->is_internalized && time(NULL) - func->access.last_checked > kAutoloadStalenessInterval;
}
autoload_function_t *autoload_t::get_autoloaded_function_with_creation(const wcstring &cmd, bool allow_eviction)
{
ASSERT_IS_LOCKED(lock);
autoload_function_t *func = this->get_node(cmd);
if (! func) {
func = new autoload_function_t(cmd);
if (allow_eviction) {
this->add_node(func);
} else {
this->add_node_without_eviction(func);
}
}
return func;
}
/**
This internal helper function does all the real work. By using two
functions, the internal function can return on various places in
the code, and the caller can take care of various cleanup work.
cmd: the command name ('grep')
really_load: whether to actually parse it as a function, or just check it it exists
reload: whether to reload it if it's already loaded
path_list: the set of paths to check
Result: if really_load is true, returns whether the function was loaded. Otherwise returns whether the function existed.
*/
bool autoload_t::locate_file_and_maybe_load_it( const wcstring &cmd, bool really_load, bool reload, const wcstring_list_t &path_list )
{
/* Note that we are NOT locked in this function! */
size_t i;
bool reloaded = 0;
/* Try using a cached function. If we really want the function to be loaded, require that it be really loaded. If we're not reloading, allow stale functions. */
{
bool allow_stale_functions = ! reload;
/* Take a lock */
scoped_lock locker(lock);
/* Get the function */
autoload_function_t * func = this->get_node(cmd);
/* Determine if we can use this cached function */
bool use_cached;
if (! func) {
/* Can't use a function that doesn't exist */
use_cached = false;
} else if ( ! allow_stale_functions && is_stale(func)) {
/* Can't use a stale function */
use_cached = false;
} else if (really_load && ! func->is_placeholder && ! func->is_loaded) {
/* Can't use an unloaded function */
use_cached = false;
} else {
/* I guess we can use it */
use_cached = true;
}
/* If we can use this function, return whether we were able to access it */
if (use_cached) {
return func->is_internalized || func->access.accessible;
}
}
/* The source of the script will end up here */
wcstring script_source;
bool has_script_source = false;
/* Whether we found an accessible file */
bool found_file = false;
/* Look for built-in scripts via a binary search */
const builtin_script_t *matching_builtin_script = NULL;
if (builtin_script_count > 0)
{
const builtin_script_t test_script = {cmd.c_str(), NULL};
const builtin_script_t *array_end = builtin_scripts + builtin_script_count;
const builtin_script_t *found = std::lower_bound(builtin_scripts, array_end, test_script, script_name_precedes_script_name);
if (found != array_end && ! wcscmp(found->name, test_script.name))
{
/* We found it */
matching_builtin_script = found;
}
}
if (matching_builtin_script) {
has_script_source = true;
script_source = str2wcstring(matching_builtin_script->def);
/* Make a node representing this function */
scoped_lock locker(lock);
autoload_function_t *func = this->get_autoloaded_function_with_creation(cmd, really_load);
/* This function is internalized */
func->is_internalized = true;
/* It's a fiction to say the script is loaded at this point, but we're definitely going to load it down below. */
if (really_load) func->is_loaded = true;
}
if (! has_script_source)
{
/* Iterate over path searching for suitable completion files */
for( i=0; i<path_list.size(); i++ )
{
wcstring next = path_list.at(i);
wcstring path = next + L"/" + cmd + L".fish";
const file_access_attempt_t access = access_file(path, R_OK);
if (access.accessible) {
/* Found it! */
found_file = true;
/* Now we're actually going to take the lock. */
scoped_lock locker(lock);
autoload_function_t *func = this->get_node(cmd);
/* Generate the source if we need to load it */
bool need_to_load_function = really_load && (func == NULL || func->access.mod_time == access.mod_time || ! func->is_loaded);
if (need_to_load_function) {
/* Generate the script source */
wcstring esc = escape_string(path, 1);
script_source = L". " + esc;
has_script_source = true;
/* Remove any loaded command because we are going to reload it. Note that this will deadlock if command_removed calls back into us. */
if (func && func->is_loaded) {
command_removed(cmd);
func->is_placeholder = false;
}
/* Mark that we're reloading it */
reloaded = true;
}
/* Create the function if we haven't yet. This does not load it. Do not trigger eviction unless we are actually loading, because we don't want to evict off of the main thread. */
if (! func) {
func = get_autoloaded_function_with_creation(cmd, really_load);
}
/* It's a fiction to say the script is loaded at this point, but we're definitely going to load it down below. */
if (need_to_load_function) func->is_loaded = true;
/* Unconditionally record our access time */
func->access = access;
break;
}
}
/*
If no file or builtin script was found we insert a placeholder function.
Later we only research if the current time is at least five seconds later.
This way, the files won't be searched over and over again.
*/
if( ! found_file && ! has_script_source )
{
scoped_lock locker(lock);
/* Generate a placeholder */
autoload_function_t *func = this->get_node(cmd);
if (! func) {
func = new autoload_function_t(cmd);
func->is_placeholder = true;
if (really_load) {
this->add_node(func);
} else {
this->add_node_without_eviction(func);
}
}
func->access.last_checked = time(NULL);
}
}
/* If we have a script, either built-in or a file source, then run it */
if (really_load && has_script_source)
{
if( exec_subshell( script_source) == -1 )
{
/*
Do nothing on failiure
*/
}
}
if (really_load) {
return reloaded;
} else {
return found_file || has_script_source;
}
}

129
autoload.h Normal file
View File

@@ -0,0 +1,129 @@
/** \file autoload.h
The classes responsible for autoloading functions and completions.
*/
#ifndef FISH_AUTOLOAD_H
#define FISH_AUTOLOAD_H
#include <wchar.h>
#include <map>
#include <set>
#include <list>
#include "common.h"
#include "lru.h"
/** A struct responsible for recording an attempt to access a file. */
struct file_access_attempt_t {
time_t mod_time; /** The modification time of the file */
time_t last_checked; /** When we last checked the file */
bool accessible; /** Whether we believe we could access this file */
bool stale; /** Whether the access attempt is stale */
int error; /** If we could not access the file, the error code */
};
file_access_attempt_t access_file(const wcstring &path, int mode);
struct autoload_function_t : public lru_node_t
{
autoload_function_t(const wcstring &key) : lru_node_t(key), access(), is_loaded(false), is_placeholder(false), is_internalized(false) { }
file_access_attempt_t access; /** The last access attempt */
bool is_loaded; /** Whether we have actually loaded this function */
bool is_placeholder; /** Whether we are a placeholder that stands in for "no such function". If this is true, then is_loaded must be false. */
bool is_internalized; /** Whether this function came from a builtin "internalized" script */
};
struct builtin_script_t;
class env_vars;
/**
A class that represents a path from which we can autoload, and the autoloaded contents.
*/
class autoload_t : private lru_cache_t<autoload_function_t> {
private:
/** Lock for thread safety */
pthread_mutex_t lock;
/** The environment variable name */
const wcstring env_var_name;
/** Builtin script array */
const struct builtin_script_t *const builtin_scripts;
/** Builtin script count */
const size_t builtin_script_count;
/** The path from which we most recently autoloaded */
wcstring last_path;
/**
A table containing all the files that are currently being
loaded. This is here to help prevent recursion.
*/
std::set<wcstring> is_loading_set;
bool is_loading(const wcstring &name) const {
return is_loading_set.find(name) != is_loading_set.end();
}
void remove_all_functions(void) {
this->evict_all_nodes();
}
bool locate_file_and_maybe_load_it( const wcstring &cmd, bool really_load, bool reload, const wcstring_list_t &path_list );
virtual void node_was_evicted(autoload_function_t *node);
autoload_function_t *get_autoloaded_function_with_creation(const wcstring &cmd, bool allow_eviction);
protected:
/** Overridable callback for when a command is removed */
virtual void command_removed(const wcstring &cmd) { }
public:
/** Create an autoload_t for the given environment variable name */
autoload_t(const wcstring &env_var_name_var, const builtin_script_t *scripts, size_t script_count );
/** Destructor */
virtual ~autoload_t();
/**
Autoload the specified file, if it exists in the specified path. Do
not load it multiple times unless it's timestamp changes or
parse_util_unload is called.
Autoloading one file may unload another.
\param cmd the filename to search for. The suffix '.fish' is always added to this name
\param on_unload a callback function to run if a suitable file is found, which has not already been run. unload will also be called for old files which are unloaded.
\param reload wheter to recheck file timestamps on already loaded files
*/
int load( const wcstring &cmd, bool reload );
/** Check whether we have tried loading the given command. Does not do any I/O. */
bool has_tried_loading( const wcstring &cmd );
/**
Tell the autoloader that the specified file, in the specified path,
is no longer loaded.
\param cmd the filename to search for. The suffix '.fish' is always added to this name
\param on_unload a callback function which will be called before (re)loading a file, may be used to unload the previous file.
\return non-zero if the file was removed, zero if the file had not yet been loaded
*/
int unload( const wcstring &cmd );
/**
Unloads all files.
*/
void unload_all( );
/** Check whether the given command could be loaded, but do not load it. */
bool can_load( const wcstring &cmd, const env_vars &vars );
};
#endif

View File

@@ -0,0 +1 @@
<pkg-contents spec="1.12"/>

View File

@@ -0,0 +1 @@
<pkgref spec="1.12" uuid="6A7E1ED5-E40E-4ACE-959B-B9D77555AD39"><config><identifier>com.ridiculousfish.fish-shell.fishShell.fish_pkg.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom>/private/tmp/fish_pkg</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo</mod><mod>parent</mod></config></pkgref>

View File

@@ -0,0 +1,40 @@
<pkmkdoc spec="1.12"><properties><title>fish shell</title><organization>com.ridiculousfish.fish-shell</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="fish_pkg" id="fish shell" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.ridiculousfish.fish-shell.fishShell.fish_pkg.pkg"/></choice></contents><resources bg-scale="proportional" bg-align="bottomleft"><locale lang="en"><resource mod="true" type="background">/Users/peter/Desktop/Untitled.pdf</resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
\f0\fs30 \cf0 This installs ridiculous_fish's fork of fish, a command line shell for Mac OS X, Linux, and the rest of the family. For more information on fish, visit {\field{\*\fldinst{HYPERLINK "http://ridiculousfish.com/shell/"}}{\fldrslt http://ridiculousfish.com/shell/}}\
\
The path to fish will be added to /etc/shells, but your default shell will not be modified. \
\
This release is beta r1.\
}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;}
{\colortbl;\red255\green255\blue255;}
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
\f0\fs26 \cf0 Run
\f1 fish
\f0 at the command line to start it up! Some useful commands:\
\
Interactively set your colors from a web page:\
\
\f1 fish_config
\f0 \
\
Update man-page completions:\
\
\f1 fish_update_completions
\f0 \
\
Make fish your default shell:\
\
\f1 chsh -s /usr/local/bin/fish\
\f0 \
\
Enjoy!\
}]]></resource></locale></resources><flags/><item type="file">01fish.xml</item><mod>properties.title</mod><mod>description</mod></pkmkdoc>

18
build_tools/make_deb.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
# Terminate on error
set -e
sudo rm -Rf /tmp/fishfish
mkdir /tmp/fishfish
git archive --format=tar fish_fish | tar -x -C /tmp/fishfish
mkdir /tmp/fishfish/doc-pak
cp README INSTALL CHANGELOG release_notes.html /tmp/fishfish/doc-pak/
cp build_tools/description-pak /tmp/fishfish/
cd /tmp/fishfish
autoconf
./configure
make -j 3
sudo checkinstall --default --pakdir ~/fish_built/ --pkgversion 0.9 make install
mv ~/fish_built/fishfish_0.9-1_i386.deb ~/fish_built/fishfish_0.9_i386.deb

31
build_tools/make_pkg.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/sh -x
make distclean
rm -rf /tmp/fish_pkg
mkdir -p /tmp/fish_pkg/
# Make sure what we build can run on SnowLeopard
export OSX_SDK="/Developer/SDKs/MacOSX10.6.sdk"
export MACOSX_DEPLOYMENT_TARGET="10.6"
export CC="clang -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CCX="clang++ -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS="$CFLAGS -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CXXFLAGS="$CXXFLAGS -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export LDFLAGS="$LDFLAGS -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
autoconf
./configure --without-xsel
# Actually build it now
if make -j 4 DESTDIR=/tmp/fish_pkg install
then
echo "Root written to /tmp/fish_pkg/"
if /Developer/usr/bin/packagemaker --doc ./build_tools/fish_shell.pmdoc --out ~/fish_built/fishfish.pkg
then
echo "Package written to ~/fish_built/fishfish.pkg"
else
echo "Package could not be written"
fi
else
echo "Root could not be written"
fi

9
build_tools/make_tarball.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
rm -f ~/fish_built/fishfish.tar.gz
if git archive --format=tar --prefix=fishfish/ fish_fish | gzip - > ~/fish_built/fishfish.tar.gz
then
echo "Tarball written to ~/fish_built/fishfish.tar.gz"
else
echo "Tarball could not be written"
fi

View File

@@ -0,0 +1,48 @@
#!/bin/sh -e
# Modified from Debian's add-shell to work on OS X
if test $# -eq 0
then
echo usage: $0 shellname [shellname ...]
exit 1
fi
scriptname=`basename "$0"`
if [[ $UID -ne 0 ]]; then
echo "${scriptname} must be run as root"
exit 1
fi
file=/etc/shells
# I want this to be GUARANTEED to be on the same filesystem as $file
tmpfile=${file}.tmp
set -o noclobber
trap "rm -f $tmpfile" EXIT
if ! cat $file > $tmpfile
then
cat 1>&2 <<EOF
Either another instance of $0 is running, or it was previously interrupted.
Please examine ${tmpfile} to see if it should be moved onto ${file}.
EOF
exit 1
fi
for i
do
if ! grep -q "^${i}$" $tmpfile
then
echo $i >> $tmpfile
fi
done
chmod 0644 $tmpfile
chown root:wheel $tmpfile
mv $tmpfile $file
trap "" EXIT
exit 0

View File

@@ -0,0 +1,3 @@
#!/bin/sh -x
./add-shell /usr/local/bin/fish > /tmp/fish_postinstall_output.log

3324
builtin.c

File diff suppressed because it is too large Load Diff

3785
builtin.cpp Normal file

File diff suppressed because it is too large Load Diff

115
builtin.h
View File

@@ -8,6 +8,10 @@
#include <wchar.h>
#include "util.h"
#include "io.h"
#include "common.h"
class parser_t;
enum
{
@@ -35,12 +39,12 @@ enum
/**
Error message on multiple scope levels for variables
*/
#define BUILTIN_ERR_GLOCAL _( L"%ls: Variable scope can only be one of universal, global and local\n%ls\n" )
#define BUILTIN_ERR_GLOCAL _( L"%ls: Variable scope can only be one of universal, global and local\n" )
/**
Error message for specifying both export and unexport to set/read
*/
#define BUILTIN_ERR_EXPUNEXP _( L"%ls: Variable can't be both exported and unexported\n%ls\n" )
#define BUILTIN_ERR_EXPUNEXP _( L"%ls: Variable can't be both exported and unexported\n" )
/**
Error message for unknown switch
@@ -58,14 +62,40 @@ enum
#define BUILTIN_ERR_VARNAME_ZERO _( L"%ls: Variable name can not be the empty string\n" )
/**
Stringbuffer used to represent standard output
Error message when second argument to for isn't 'in'
*/
extern string_buffer_t *sb_out;
#define BUILTIN_FOR_ERR_IN _( L"%ls: Second argument must be 'in'\n" )
/**
Stringbuffer used to represent standard error
Error message for insufficient number of arguments
*/
extern string_buffer_t *sb_err;
#define BUILTIN_FOR_ERR_COUNT _( L"%ls: Expected at least two arguments, got %d\n")
#define BUILTIN_FOR_ERR_NAME _( L"%ls: '%ls' is not a valid variable name\n" )
/**
Error message when too many arguments are supplied to a builtin
*/
#define BUILTIN_ERR_TOO_MANY_ARGUMENTS _( L"%ls: Too many arguments\n" )
/**
Error message when block types mismatch in the end builtin, e.g. 'begin; end for'
*/
#define BUILTIN_END_BLOCK_MISMATCH _( L"%ls: Block mismatch: '%ls' vs. '%ls'\n" )
/**
Error message for unknown block type in the end builtin, e.g. 'begin; end beggin'
*/
#define BUILTIN_END_BLOCK_UNKNOWN _( L"%ls: Unknown block type '%ls'\n" )
#define BUILTIN_ERR_NOT_NUMBER _( L"%ls: Argument '%ls' is not a number\n" )
/** Get the string used to represent stdout and stderr */
const wcstring &get_stdout_buffer();
const wcstring &get_stderr_buffer();
/** Output an error */
void builtin_show_error(const wcstring &err);
/**
Kludge. Tells builtins if output is to screen
@@ -91,81 +121,58 @@ void builtin_destroy();
/**
Is there a builtin command with the given name?
*/
int builtin_exists( wchar_t *cmd );
int builtin_exists( const wcstring &cmd );
/**
Execute a builtin command
\param parser The parser being used
\param argv Array containing the command and parameters
of the builtin. The list is terminated by a
null pointer. This syntax resembles the syntax
for exec.
\param io the io redirections to perform on this builtin.
\return the exit status of the builtin command
*/
int builtin_run( wchar_t **argv );
int builtin_run( parser_t &parser, const wchar_t * const *argv, io_data_t *io );
/** Returns a list of all builtin names */
wcstring_list_t builtin_get_names(void);
/** Insert all builtin names into list. */
void builtin_get_names(std::vector<completion_t> &list);
/**
Insert all builtin names into l. These are not copies of the strings and should not be freed after use.
Pushes a new set of input/output to the stack. The new stdin is supplied, a new set of output strings is created.
*/
void builtin_get_names( array_list_t *list );
void builtin_push_io( parser_t &parser, int stdin_fd );
/**
Pushes a new set of input/output to the stack. The new stdin is supplied, a new set of output string_buffer_ts is created.
Pops a set of input/output from the stack. The output strings are destroued, but the input file is not closed.
*/
void builtin_push_io( int stdin_fd );
/**
Pops a set of input/output from the stack. The output string_buffer_ts are destroued, but the input file is not closed.
*/
void builtin_pop_io();
void builtin_pop_io(parser_t &parser);
/**
Return a one-line description of the specified builtin
Return a one-line description of the specified builtin.
*/
const wchar_t *builtin_get_desc( const wchar_t *b );
/**
Counts the number of non null pointers in the specified array
*/
int builtin_count_args( wchar_t **argv );
/**
Print help for the specified builtin. If \c b is sb_err, also print the line information
*/
void builtin_print_help( wchar_t *cmd, string_buffer_t *b );
wcstring builtin_get_desc( const wcstring &b );
/**
The set builtin, used for setting variables. Defined in builtin_set.c.
Slightly kludgy function used with 'complete -C' in order to make
the commandline builtin operate on the string to complete instead
of operating on whatever is to be completed.
*/
int builtin_set(wchar_t **argv);
/**
The commandline builtin, used for setting and getting the contents of the commandline. Defined in builtin_commandline.c.
*/
int builtin_commandline(wchar_t **argv);
/**
The ulimit builtin, used for setting resource limits. Defined in builtin_ulimit.c.
*/
int builtin_ulimit(wchar_t **argv);
/**
The complete builtin. Used for specifying programmable
tab-completions. Calls the functions in complete.c for any heavy
lifting.
*/
int builtin_complete(wchar_t **argv);
const wchar_t *builtin_complete_get_temporary_buffer();
/**
This function works like wperror, but it prints its result into
the sb_err string_buffer_t instead of to stderr. Used by the builtin
commands.
/**
Run the __fish_print_help function to obtain the help information
for the specified command.
*/
void builtin_wperror( const wchar_t *s);
wcstring builtin_help_get( parser_t &parser, const wchar_t *cmd );
#endif

View File

@@ -3,6 +3,8 @@
Functions used for implementing the commandline builtin.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
@@ -11,8 +13,6 @@ Functions used for implementing the commandline builtin.
#include <termios.h>
#include <signal.h>
#include "config.h"
#include "fallback.h"
#include "util.h"
@@ -26,7 +26,7 @@ Functions used for implementing the commandline builtin.
#include "tokenizer.h"
#include "input_common.h"
#include "input.h"
#include "translate.h"
#include "parse_util.h"
/**
@@ -52,24 +52,31 @@ enum
}
;
/**
Pointer to what the commandline builtin considers to be the current
contents of the command line buffer.
*/
static const wchar_t *current_buffer=0;
/**
What the commandline builtin considers to be the current cursor
position.
*/
static int current_cursor_pos = -1;
/**
Returns the current commandline buffer.
*/
static const wchar_t *get_buffer()
{
const wchar_t *buff = builtin_complete_get_temporary_buffer();
if( !buff )
buff = reader_get_buffer();
return buff;
return current_buffer;
}
/**
Returns the position of the cursor
*/
static int get_cursor_pos()
{
const wchar_t *buff = builtin_complete_get_temporary_buffer();
if( buff )
return wcslen( buff );
else
return reader_get_cursor_pos();
return current_cursor_pos;
}
@@ -83,46 +90,44 @@ static int get_cursor_pos()
*/
static void replace_part( const wchar_t *begin,
const wchar_t *end,
wchar_t *insert,
const wchar_t *insert,
int append_mode )
{
const wchar_t *buff = get_buffer();
string_buffer_t out;
int out_pos=get_cursor_pos();
sb_init( &out );
wcstring out;
sb_append_substring( &out, buff, begin-buff );
out.append(buff, begin - buff);
switch( append_mode)
{
case REPLACE_MODE:
{
sb_append( &out, insert );
out.append(insert);
out_pos = wcslen( insert ) + (begin-buff);
break;
}
case APPEND_MODE:
{
sb_append_substring( &out, begin, end-begin );
sb_append( &out, insert );
out.append( begin, end-begin );
out.append( insert );
break;
}
case INSERT_MODE:
{
int cursor = get_cursor_pos() -(begin-buff);
sb_append_substring( &out, begin, cursor );
sb_append( &out, insert );
sb_append_substring( &out, begin+cursor, end-begin-cursor );
out.append( begin, cursor );
out.append( insert );
out.append( begin+cursor, end-begin-cursor );
out_pos += wcslen( insert );
break;
}
}
sb_append( &out, end );
reader_set_buffer( (wchar_t *)out.buff, out_pos );
sb_destroy( &out );
out.append( end );
reader_set_buffer( out, out_pos );
}
/**
@@ -139,18 +144,17 @@ static void write_part( const wchar_t *begin,
int tokenize )
{
tokenizer tok;
string_buffer_t out;
wcstring out;
wchar_t *buff;
int pos;
size_t pos;
pos = get_cursor_pos()-(begin-get_buffer());
if( tokenize )
{
buff = wcsndup( begin, end-begin );
// fwprintf( stderr, L"Subshell: %ls, end char %lc\n", buff, *end );
sb_init( &out );
out.clear();
for( tok_init( &tok, buff, TOK_ACCEPT_UNFINISHED );
tok_has_next( &tok );
@@ -160,24 +164,22 @@ static void write_part( const wchar_t *begin,
(tok_get_pos( &tok)+wcslen(tok_last( &tok)) >= pos) )
break;
// fwprintf( stderr, L"Next token %ls\n", tok_last( &tok ) );
switch( tok_last_type( &tok ) )
{
case TOK_STRING:
sb_append2( &out, tok_last( &tok), L"\n", (void *)0 );
{
out.append(escape_string(tok_last( &tok ), UNESCAPE_INCOMPLETE));
out.push_back(L'\n');
break;
}
}
}
if( out.buff )
sb_append( sb_out,
(wchar_t *)out.buff );
stdout_buffer.append(out);
free( buff );
tok_destroy( &tok );
sb_destroy( &out );
}
else
{
@@ -185,8 +187,12 @@ static void write_part( const wchar_t *begin,
{
end = begin+pos;
}
sb_append_substring( sb_out, begin, end-begin );
sb_append( sb_out, L"\n" );
// debug( 0, L"woot2 %ls -> %ls", buff, esc );
stdout_buffer.append(begin, end - begin);
stdout_buffer.append(L"\n");
}
}
@@ -195,7 +201,7 @@ static void write_part( const wchar_t *begin,
The commandline builtin. It is used for specifying a new value for
the commandline.
*/
int builtin_commandline( wchar_t **argv )
static int builtin_commandline( parser_t &parser, wchar_t **argv )
{
int buffer_part=0;
@@ -207,22 +213,46 @@ int builtin_commandline( wchar_t **argv )
int function_mode = 0;
int tokenize = 0;
int cursor_mode = 0;
int line_mode = 0;
int search_mode = 0;
const wchar_t *begin, *end;
current_buffer = (wchar_t *)builtin_complete_get_temporary_buffer();
if( current_buffer )
{
current_cursor_pos = wcslen( current_buffer );
}
else
{
current_buffer = reader_get_buffer();
current_cursor_pos = reader_get_cursor_pos();
}
if( !get_buffer() )
{
sb_append2( sb_err,
argv[0],
L": Can not set commandline in non-interactive mode\n",
(void *)0 );
builtin_print_help( argv[0], sb_err );
return 1;
}
if (is_interactive_session)
{
/*
Prompt change requested while we don't have
a prompt, most probably while reading the
init files. Just ignore it.
*/
return 1;
}
stderr_buffer.append(argv[0]);
stderr_buffer.append(L": Can not set commandline in non-interactive mode\n");
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
woptind=0;
while( 1 )
{
const static struct woption
static const struct woption
long_options[] =
{
{
@@ -265,6 +295,26 @@ int builtin_commandline( wchar_t **argv )
L"tokenize", no_argument, 0, 'o'
}
,
{
L"help", no_argument, 0, 'h'
}
,
{
L"input", required_argument, 0, 'I'
}
,
{
L"cursor", no_argument, 0, 'C'
}
,
{
L"line", no_argument, 0, 'L'
}
,
{
L"search-mode", no_argument, 0, 'S'
}
,
{
0, 0, 0, 0
}
@@ -275,7 +325,7 @@ int builtin_commandline( wchar_t **argv )
int opt = wgetopt_long( argc,
argv,
L"aijpctwfor",
L"abijpctwforhI:CLS",
long_options,
&opt_index );
if( opt == -1 )
@@ -286,17 +336,22 @@ int builtin_commandline( wchar_t **argv )
case 0:
if(long_options[opt_index].flag != 0)
break;
sb_printf( sb_err,
append_format( stderr_buffer,
BUILTIN_ERR_UNKNOWN,
argv[0],
long_options[opt_index].name );
builtin_print_help( argv[0], sb_err );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
case L'a':
append_mode = APPEND_MODE;
break;
case L'b':
buffer_part = STRING_MODE;
break;
case L'i':
append_mode = INSERT_MODE;
@@ -330,8 +385,29 @@ int builtin_commandline( wchar_t **argv )
tokenize=1;
break;
case 'I':
current_buffer = woptarg;
current_cursor_pos = wcslen( woptarg );
break;
case 'C':
cursor_mode = 1;
break;
case 'L':
line_mode = 1;
break;
case 'S':
search_mode = 1;
break;
case 'h':
builtin_print_help( parser, argv[0], stdout_buffer );
return 0;
case L'?':
builtin_print_help( argv[0], sb_err );
builtin_unknown_option( parser, argv[0], argv[woptind-1] );
return 1;
}
}
@@ -343,39 +419,31 @@ int builtin_commandline( wchar_t **argv )
/*
Check for invalid switch combinations
*/
if( buffer_part || cut_at_cursor || append_mode || tokenize )
if( buffer_part || cut_at_cursor || append_mode || tokenize || cursor_mode || line_mode || search_mode )
{
sb_printf(sb_err,
append_format(stderr_buffer,
BUILTIN_ERR_COMBO,
argv[0] );
sb_append2(sb_err,
parser_current_line(),
L"\n",
(void *)0);
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
if( argc == woptind )
{
sb_printf( sb_err,
append_format(stderr_buffer,
BUILTIN_ERR_MISSING,
argv[0] );
sb_append2( sb_err,
parser_current_line(),
L"\n",
(void *)0 );
builtin_print_help( argv[0], sb_err );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
for( i=woptind; i<argc; i++ )
{
wint_t c = input_get_code( argv[i] );
wint_t c = input_function_get_code( argv[i] );
if( c != -1 )
{
// fwprintf( stderr, L"Add function %ls (%d)\n", argv[i], c );
/*
input_unreadch inserts the specified keypress or
readline function at the top of the stack of unused
@@ -385,16 +453,11 @@ int builtin_commandline( wchar_t **argv )
}
else
{
// fwprintf( stderr, L"BLUR %ls %d\n", argv[i], c );
sb_append2( sb_err,
argv[0],
L": Unknown readline function '",
argv[i],
L"'\n",
parser_current_line(),
L"\n",
(void *)0 );
builtin_print_help( argv[0], sb_err );
append_format(stderr_buffer,
_(L"%ls: Unknown input function '%ls'\n"),
argv[0],
argv[i] );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
}
@@ -405,38 +468,48 @@ int builtin_commandline( wchar_t **argv )
/*
Check for invalid switch combinations
*/
if( argc-woptind > 1 )
if( (search_mode || line_mode || cursor_mode) && (argc-woptind > 1) )
{
sb_append2( sb_err,
append_format(stderr_buffer,
argv[0],
L": Too many arguments\n",
(void *)0 );
builtin_print_help( argv[0], sb_err );
NULL );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
if( (buffer_part || tokenize || cut_at_cursor) && (cursor_mode || line_mode || search_mode) )
{
append_format(stderr_buffer,
BUILTIN_ERR_COMBO,
argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
if( (tokenize || cut_at_cursor) && (argc-woptind) )
{
sb_printf( sb_err,
append_format(stderr_buffer,
BUILTIN_ERR_COMBO2,
argv[0],
L"--cut-at-cursor and --tokenize can not be used when setting the commandline" );
builtin_print_help( argv[0], sb_err );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
if( append_mode && !(argc-woptind) )
{
sb_printf( sb_err,
append_format(stderr_buffer,
BUILTIN_ERR_COMBO2,
argv[0],
L"insertion mode switches can not be used when not in insertion mode" );
builtin_print_help( argv[0], sb_err );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
@@ -452,9 +525,53 @@ int builtin_commandline( wchar_t **argv )
{
buffer_part = STRING_MODE;
}
if( cursor_mode )
{
if( argc-woptind )
{
wchar_t *endptr;
int new_pos;
errno = 0;
new_pos = wcstol( argv[woptind], &endptr, 10 );
if( *endptr || errno )
{
append_format(stderr_buffer,
BUILTIN_ERR_NOT_NUMBER,
argv[0],
argv[woptind] );
builtin_print_help( parser, argv[0], stderr_buffer );
}
current_buffer = reader_get_buffer();
new_pos = maxi( 0, mini( new_pos, wcslen( current_buffer ) ) );
reader_set_buffer( current_buffer, new_pos );
return 0;
}
else
{
append_format(stdout_buffer, L"%d\n", reader_get_cursor_pos() );
return 0;
}
const wchar_t *begin, *end;
}
if( line_mode )
{
int pos = reader_get_cursor_pos();
const wchar_t *buff = reader_get_buffer();
append_format(stdout_buffer, L"%d\n", parse_util_lineno( buff, pos ) );
return 0;
}
if( search_mode )
{
return !reader_search_mode();
}
switch( buffer_part )
{
case STRING_MODE:
@@ -505,7 +622,23 @@ int builtin_commandline( wchar_t **argv )
case 1:
{
replace_part( begin, end, argv[woptind], append_mode );
break;
break;
}
default:
{
wcstring sb = argv[woptind];
int i;
for( i=woptind+1; i<argc; i++ )
{
sb.push_back(L'\n');
sb.append(argv[i]);
}
replace_part( begin, end, sb.c_str(), append_mode );
break;
}
}

View File

@@ -1,535 +0,0 @@
/** \file builtin_complete.c Functions defining the complete builtin
Functions used for implementing the complete builtin.
*/
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#include <sys/types.h>
#include <termios.h>
#include <signal.h>
#include "config.h"
#include "fallback.h"
#include "util.h"
#include "wutil.h"
#include "builtin.h"
#include "common.h"
#include "complete.h"
#include "wgetopt.h"
#include "parser.h"
#include "reader.h"
#include "translate.h"
const static wchar_t *temporary_buffer;
/*
builtin_complete_* are a set of rather silly looping functions that
make sure that all the proper combinations of complete_add or
complete_remove get called.
*/
static void builtin_complete_add2( const wchar_t *cmd,
int cmd_type,
const wchar_t *short_opt,
array_list_t *gnu_opt,
array_list_t *old_opt,
int result_mode,
int authorative,
const wchar_t *condition,
const wchar_t *comp,
const wchar_t *desc )
{
int i;
const wchar_t *s;
for( s=short_opt; *s; s++ )
{
complete_add( cmd,
cmd_type,
*s,
0,
0,
result_mode,
authorative,
condition,
comp,
desc );
}
for( i=0; i<al_get_count( gnu_opt ); i++ )
{
complete_add( cmd,
cmd_type,
0,
(wchar_t *)al_get(gnu_opt, i ),
0,
result_mode,
authorative,
condition,
comp,
desc );
}
for( i=0; i<al_get_count( old_opt ); i++ )
{
complete_add( cmd,
cmd_type,
0,
(wchar_t *)al_get(old_opt, i ),
1,
result_mode,
authorative,
condition,
comp,
desc );
}
if( al_get_count( old_opt )+al_get_count( gnu_opt )+wcslen(short_opt) == 0 )
{
complete_add( cmd,
cmd_type,
0,
0,
0,
result_mode,
authorative,
condition,
comp,
desc );
}
}
static void builtin_complete_add( array_list_t *cmd,
array_list_t *path,
const wchar_t *short_opt,
array_list_t *gnu_opt,
array_list_t *old_opt,
int result_mode,
int authorative,
const wchar_t *condition,
const wchar_t *comp,
const wchar_t *desc )
{
int i;
for( i=0; i<al_get_count( cmd ); i++ )
{
builtin_complete_add2( al_get( cmd, i ),
COMMAND,
short_opt,
gnu_opt,
old_opt,
result_mode,
authorative,
condition,
comp,
desc );
}
for( i=0; i<al_get_count( path ); i++ )
{
builtin_complete_add2( al_get( path, i ),
PATH,
short_opt,
gnu_opt,
old_opt,
result_mode,
authorative,
condition,
comp,
desc );
}
}
static void builtin_complete_remove3( wchar_t *cmd,
int cmd_type,
wchar_t short_opt,
array_list_t *long_opt )
{
int i;
for( i=0; i<al_get_count( long_opt ); i++ )
{
complete_remove( cmd,
cmd_type,
short_opt,
(wchar_t *)al_get( long_opt, i ) );
}
}
static void builtin_complete_remove2( wchar_t *cmd,
int cmd_type,
const wchar_t *short_opt,
array_list_t *gnu_opt,
array_list_t *old_opt )
{
const wchar_t *s = (wchar_t *)short_opt;
if( *s )
{
for( ; *s; s++ )
{
if( al_get_count( old_opt) + al_get_count( gnu_opt ) == 0 )
{
complete_remove(cmd,
cmd_type,
*s,
0 );
}
else
{
builtin_complete_remove3( cmd,
cmd_type,
*s,
gnu_opt );
builtin_complete_remove3( cmd,
cmd_type,
*s,
old_opt );
}
}
}
else
{
builtin_complete_remove3( cmd,
cmd_type,
0,
gnu_opt );
builtin_complete_remove3( cmd,
cmd_type,
0,
old_opt );
}
}
static void builtin_complete_remove( array_list_t *cmd,
array_list_t *path,
const wchar_t *short_opt,
array_list_t *gnu_opt,
array_list_t *old_opt )
{
int i;
for( i=0; i<al_get_count( cmd ); i++ )
{
builtin_complete_remove2( (wchar_t *)al_get( cmd, i ),
COMMAND,
short_opt,
gnu_opt,
old_opt );
}
for( i=0; i<al_get_count( path ); i++ )
{
builtin_complete_remove2( (wchar_t *)al_get( path, i ),
PATH,
short_opt,
gnu_opt,
old_opt );
}
}
const wchar_t *builtin_complete_get_temporary_buffer()
{
return temporary_buffer;
}
int builtin_complete( wchar_t **argv )
{
int res=0;
int argc=0;
int result_mode=SHARED;
int remove = 0;
int authorative = 1;
string_buffer_t short_opt;
array_list_t gnu_opt, old_opt;
wchar_t *comp=L"", *desc=L"", *condition=L"";
wchar_t *do_complete = 0;
array_list_t cmd;
array_list_t path;
static int recursion_level=0;
if( !is_interactive_session )
{
debug( 1, _(L"%ls: Command only available in interactive sessions"), argv[0] );
}
al_init( &cmd );
al_init( &path );
sb_init( &short_opt );
al_init( &gnu_opt );
al_init( &old_opt );
argc = builtin_count_args( argv );
woptind=0;
while( res == 0 )
{
const static struct woption
long_options[] =
{
{
L"exclusive", no_argument, 0, 'x'
}
,
{
L"no-files", no_argument, 0, 'f'
}
,
{
L"require-parameter", no_argument, 0, 'r'
}
,
{
L"path", required_argument, 0, 'p'
}
,
{
L"command", required_argument, 0, 'c'
}
,
{
L"short-option", required_argument, 0, 's'
}
,
{
L"long-option", required_argument, 0, 'l'
}
,
{
L"old-option", required_argument, 0, 'o'
}
,
{
L"description", required_argument, 0, 'd'
}
,
{
L"arguments", required_argument, 0, 'a'
}
,
{
L"erase", no_argument, 0, 'e'
}
,
{
L"unauthorative", no_argument, 0, 'u'
}
,
{
L"condition", required_argument, 0, 'n'
}
,
{
L"do-complete", required_argument, 0, 'C'
}
,
{
0, 0, 0, 0
}
}
;
int opt_index = 0;
int opt = wgetopt_long( argc,
argv,
L"a:c:p:s:l:o:d:frxeun:C:",
long_options,
&opt_index );
if( opt == -1 )
break;
switch( opt )
{
case 0:
if(long_options[opt_index].flag != 0)
break;
sb_printf( sb_err,
BUILTIN_ERR_UNKNOWN,
argv[0],
long_options[opt_index].name );
sb_append( sb_err,
parser_current_line() );
// builtin_print_help( argv[0], sb_err );
res = 1;
break;
case 'x':
result_mode |= EXCLUSIVE;
break;
case 'f':
result_mode |= NO_FILES;
break;
case 'r':
result_mode |= NO_COMMON;
break;
case 'p':
al_push( &cmd, unescape( woptarg, 1));
break;
case 'c':
al_push( &cmd, unescape( woptarg, 1) );
break;
case 'd':
desc = woptarg;
break;
case 'u':
authorative=0;
break;
case 's':
sb_append( &short_opt, woptarg );
break;
case 'l':
al_push( &gnu_opt, woptarg );
break;
case 'o':
al_push( &old_opt, woptarg );
break;
case 'a':
comp = woptarg;
break;
case 'e':
remove = 1;
break;
case 'n':
condition = woptarg;
break;
case 'C':
do_complete = woptarg?woptarg:reader_get_buffer();
break;
case '?':
sb_append( sb_err,
parser_current_line() );
// builtin_print_help( argv[0], sb_err );
res = 1;
break;
}
}
if( !res )
{
if( do_complete )
{
array_list_t comp;
int i;
const wchar_t *prev_temporary_buffer = temporary_buffer;
temporary_buffer = do_complete;
if( recursion_level < 1 )
{
recursion_level++;
al_init( &comp );
complete( do_complete, &comp );
for( i=0; i<al_get_count( &comp ); i++ )
{
wchar_t *next = (wchar_t *)al_get( &comp, i );
wchar_t *sep = wcschr( next, COMPLETE_SEP );
if( sep )
*sep = L'\t';
sb_printf( sb_out, L"%ls\n", next );
}
al_foreach( &comp, (void (*)(const void *))&free );
al_destroy( &comp );
recursion_level--;
}
temporary_buffer = prev_temporary_buffer;
}
else if( woptind != argc )
{
sb_printf( sb_err,
_( L"%ls: Too many arguments\n" ),
argv[0] );
sb_append( sb_err,
parser_current_line() );
// builtin_print_help( argv[0], sb_err );
res = 1;
}
else if( (al_get_count( &cmd) == 0 ) && (al_get_count( &path) == 0 ) )
{
/* No arguments specified, meaning we print the definitions of
* all specified completions to stdout.*/
complete_print( sb_out );
}
else
{
if( remove )
{
builtin_complete_remove( &cmd,
&path,
(wchar_t *)short_opt.buff,
&gnu_opt,
&old_opt );
}
else
{
builtin_complete_add( &cmd,
&path,
(wchar_t *)short_opt.buff,
&gnu_opt,
&old_opt,
result_mode,
authorative,
condition,
comp,
desc );
}
}
}
al_foreach( &cmd, (void (*)(const void *))&free );
al_foreach( &path, (void (*)(const void *))&free );
al_destroy( &cmd );
al_destroy( &path );
sb_destroy( &short_opt );
al_destroy( &gnu_opt );
al_destroy( &old_opt );
return res;
}

626
builtin_complete.cpp Normal file
View File

@@ -0,0 +1,626 @@
/** \file builtin_complete.c Functions defining the complete builtin
Functions used for implementing the complete builtin.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#include <sys/types.h>
#include <termios.h>
#include <signal.h>
#include "fallback.h"
#include "util.h"
#include "wutil.h"
#include "builtin.h"
#include "common.h"
#include "complete.h"
#include "wgetopt.h"
#include "parser.h"
#include "reader.h"
/**
Internal storage for the builtin_complete_get_temporary_buffer() function.
*/
static const wchar_t *temporary_buffer;
/*
builtin_complete_* are a set of rather silly looping functions that
make sure that all the proper combinations of complete_add or
complete_remove get called. This is needed since complete allows you
to specify multiple switches on a single commandline, like 'complete
-s a -s b -s c', but the complete_add function only accepts one
short switch and one long switch.
*/
/**
Silly function
*/
static void builtin_complete_add2( const wchar_t *cmd,
int cmd_type,
const wchar_t *short_opt,
const wcstring_list_t &gnu_opt,
const wcstring_list_t &old_opt,
int result_mode,
const wchar_t *condition,
const wchar_t *comp,
const wchar_t *desc,
int flags )
{
size_t i;
const wchar_t *s;
for( s=short_opt; *s; s++ )
{
complete_add( cmd,
cmd_type,
*s,
0,
0,
result_mode,
condition,
comp,
desc,
flags );
}
for( i=0; i<gnu_opt.size(); i++ )
{
complete_add( cmd,
cmd_type,
0,
gnu_opt.at(i).c_str(),
0,
result_mode,
condition,
comp,
desc,
flags );
}
for( i=0; i<old_opt.size(); i++ )
{
complete_add( cmd,
cmd_type,
0,
old_opt.at(i).c_str(),
1,
result_mode,
condition,
comp,
desc,
flags );
}
if( old_opt.size() == 0 && gnu_opt.size() == 0 && wcslen(short_opt) == 0 )
{
complete_add( cmd,
cmd_type,
0,
0,
0,
result_mode,
condition,
comp,
desc,
flags );
}
}
/**
Silly function
*/
static void builtin_complete_add( const wcstring_list_t &cmd,
const wcstring_list_t &path,
const wchar_t *short_opt,
wcstring_list_t &gnu_opt,
wcstring_list_t &old_opt,
int result_mode,
int authoritative,
const wchar_t *condition,
const wchar_t *comp,
const wchar_t *desc,
int flags )
{
for( size_t i=0; i<cmd.size(); i++ )
{
builtin_complete_add2( cmd.at(i).c_str(),
COMMAND,
short_opt,
gnu_opt,
old_opt,
result_mode,
condition,
comp,
desc,
flags );
if( authoritative != -1 )
{
complete_set_authoritative( cmd.at(i).c_str(),
COMMAND,
authoritative );
}
}
for( size_t i=0; i<path.size(); i++ )
{
builtin_complete_add2( path.at(i).c_str(),
PATH,
short_opt,
gnu_opt,
old_opt,
result_mode,
condition,
comp,
desc,
flags );
if( authoritative != -1 )
{
complete_set_authoritative( path.at(i).c_str(),
PATH,
authoritative );
}
}
}
/**
Silly function
*/
static void builtin_complete_remove3( const wchar_t *cmd,
int cmd_type,
wchar_t short_opt,
const wcstring_list_t &long_opt )
{
for( size_t i=0; i<long_opt.size(); i++ )
{
complete_remove( cmd,
cmd_type,
short_opt,
long_opt.at(i).c_str());
}
}
/**
Silly function
*/
static void builtin_complete_remove2( const wchar_t *cmd,
int cmd_type,
const wchar_t *short_opt,
const wcstring_list_t &gnu_opt,
const wcstring_list_t &old_opt )
{
const wchar_t *s = (wchar_t *)short_opt;
if( *s )
{
for( ; *s; s++ )
{
if( old_opt.size() == 0 && gnu_opt.size() == 0 )
{
complete_remove(cmd,
cmd_type,
*s,
0 );
}
else
{
builtin_complete_remove3( cmd,
cmd_type,
*s,
gnu_opt );
builtin_complete_remove3( cmd,
cmd_type,
*s,
old_opt );
}
}
}
else
{
builtin_complete_remove3( cmd,
cmd_type,
0,
gnu_opt );
builtin_complete_remove3( cmd,
cmd_type,
0,
old_opt );
}
}
/**
Silly function
*/
static void builtin_complete_remove( const wcstring_list_t &cmd,
const wcstring_list_t &path,
const wchar_t *short_opt,
const wcstring_list_t &gnu_opt,
const wcstring_list_t &old_opt )
{
for( size_t i=0; i<cmd.size(); i++ )
{
builtin_complete_remove2( cmd.at(i).c_str(),
COMMAND,
short_opt,
gnu_opt,
old_opt );
}
for( size_t i=0; i<path.size(); i++ )
{
builtin_complete_remove2( path.at(i).c_str(),
PATH,
short_opt,
gnu_opt,
old_opt );
}
}
const wchar_t *builtin_complete_get_temporary_buffer()
{
ASSERT_IS_MAIN_THREAD();
return temporary_buffer;
}
/**
The complete builtin. Used for specifying programmable
tab-completions. Calls the functions in complete.c for any heavy
lifting. Defined in builtin_complete.c
*/
static int builtin_complete( parser_t &parser, wchar_t **argv )
{
ASSERT_IS_MAIN_THREAD();
bool res=false;
int argc=0;
int result_mode=SHARED;
int remove = 0;
int authoritative = -1;
int flags = COMPLETE_AUTO_SPACE;
wcstring short_opt;
wcstring_list_t gnu_opt, old_opt;
const wchar_t *comp=L"", *desc=L"", *condition=L"";
bool do_complete = false;
wcstring do_complete_param;
wcstring_list_t cmd;
wcstring_list_t path;
static int recursion_level=0;
argc = builtin_count_args( argv );
woptind=0;
while( ! res )
{
static const struct woption
long_options[] =
{
{
L"exclusive", no_argument, 0, 'x'
}
,
{
L"no-files", no_argument, 0, 'f'
}
,
{
L"require-parameter", no_argument, 0, 'r'
}
,
{
L"path", required_argument, 0, 'p'
}
,
{
L"command", required_argument, 0, 'c'
}
,
{
L"short-option", required_argument, 0, 's'
}
,
{
L"long-option", required_argument, 0, 'l'
}
,
{
L"old-option", required_argument, 0, 'o'
}
,
{
L"description", required_argument, 0, 'd'
}
,
{
L"arguments", required_argument, 0, 'a'
}
,
{
L"erase", no_argument, 0, 'e'
}
,
{
L"unauthoritative", no_argument, 0, 'u'
}
,
{
L"authoritative", no_argument, 0, 'A'
}
,
{
L"condition", required_argument, 0, 'n'
}
,
{
L"do-complete", optional_argument, 0, 'C'
}
,
{
L"help", no_argument, 0, 'h'
}
,
{
0, 0, 0, 0
}
}
;
int opt_index = 0;
int opt = wgetopt_long( argc,
argv,
L"a:c:p:s:l:o:d:frxeuAn:C::h",
long_options,
&opt_index );
if( opt == -1 )
break;
switch( opt )
{
case 0:
if(long_options[opt_index].flag != 0)
break;
append_format(stderr_buffer,
BUILTIN_ERR_UNKNOWN,
argv[0],
long_options[opt_index].name );
builtin_print_help( parser, argv[0], stderr_buffer );
res = true;
break;
case 'x':
result_mode |= EXCLUSIVE;
break;
case 'f':
result_mode |= NO_FILES;
break;
case 'r':
result_mode |= NO_COMMON;
break;
case 'p':
case 'c':
{
wcstring tmp = woptarg;
if (unescape_string(tmp, 1))
{
if (opt=='p')
path.push_back(tmp);
else
cmd.push_back(tmp);
}
else
{
append_format(stderr_buffer, L"%ls: Invalid token '%ls'\n", argv[0], woptarg );
res = true;
}
break;
}
case 'd':
desc = woptarg;
break;
case 'u':
authoritative=0;
break;
case 'A':
authoritative=1;
break;
case 's':
short_opt.append(woptarg);
break;
case 'l':
gnu_opt.push_back(woptarg);
break;
case 'o':
old_opt.push_back(woptarg);
break;
case 'a':
comp = woptarg;
break;
case 'e':
remove = 1;
break;
case 'n':
condition = woptarg;
break;
case 'C':
do_complete = true;
do_complete_param = woptarg ? woptarg : reader_get_buffer();
break;
case 'h':
builtin_print_help( parser, argv[0], stdout_buffer );
return 0;
case '?':
builtin_unknown_option( parser, argv[0], argv[woptind-1] );
res = true;
break;
}
}
if( !res )
{
if( condition && wcslen( condition ) )
{
if( parser.test( condition, 0, 0, 0 ) )
{
append_format(stderr_buffer,
L"%ls: Condition '%ls' contained a syntax error\n",
argv[0],
condition );
parser.test( condition, 0, &stderr_buffer, argv[0] );
res = true;
}
}
}
if( !res )
{
if( comp && wcslen( comp ) )
{
if( parser.test_args( comp, 0, 0 ) )
{
append_format(stderr_buffer,
L"%ls: Completion '%ls' contained a syntax error\n",
argv[0],
comp );
parser.test_args( comp, &stderr_buffer, argv[0] );
res = true;
}
}
}
if( !res )
{
if( do_complete )
{
const wchar_t *token;
parse_util_token_extent( do_complete_param.c_str(), do_complete_param.size(), &token, 0, 0, 0 );
const wchar_t *prev_temporary_buffer = temporary_buffer;
temporary_buffer = do_complete_param.c_str();
if( recursion_level < 1 )
{
recursion_level++;
std::vector<completion_t> comp;
complete( do_complete_param, comp, COMPLETE_DEFAULT );
for( size_t i=0; i< comp.size() ; i++ )
{
const completion_t &next = comp.at( i );
const wchar_t *prepend;
if( next.flags & COMPLETE_NO_CASE )
{
prepend = L"";
}
else
{
prepend = token;
}
if( !(next.description).empty() )
{
append_format(stdout_buffer, L"%ls%ls\t%ls\n", prepend, next.completion.c_str(), next.description.c_str() );
}
else
{
append_format(stdout_buffer, L"%ls%ls\n", prepend, next.completion.c_str() );
}
}
recursion_level--;
}
temporary_buffer = prev_temporary_buffer;
}
else if( woptind != argc )
{
append_format(stderr_buffer,
_( L"%ls: Too many arguments\n" ),
argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
res = true;
}
else if( cmd.empty() && path.empty() )
{
/* No arguments specified, meaning we print the definitions of
* all specified completions to stdout.*/
complete_print( stdout_buffer );
}
else
{
if( remove )
{
builtin_complete_remove( cmd,
path,
short_opt.c_str(),
gnu_opt,
old_opt );
}
else
{
builtin_complete_add( cmd,
path,
short_opt.c_str(),
gnu_opt,
old_opt,
result_mode,
authoritative,
condition,
comp,
desc,
flags );
}
}
}
return res ? 1 : 0;
}

View File

@@ -1,32 +0,0 @@
/** \file builtin_help.h
Prototypes for functions for printing usage information of builtin commands. The
corresponding .c file is automatically generated by combining the
builtin_help.hdr file with doxygen output.
*/
#ifndef FISH_BUILTIN_HELP_H
#define FISH_BUILTIN_HELP_H
#include <wchar.h>
/**
Return the help text for the specified builtin command. Use
non-wide characters since wide characters have some issues with
string formating escape sequences sometimes.
\param cmd The command for which to obtain help text
*/
char *builtin_help_get( wchar_t *cmd );
/**
Initialize builtin help data
*/
void builtin_help_init();
/**
Destory builtin help data
*/
void builtin_help_destroy();
#endif

View File

@@ -1,37 +0,0 @@
/** \file builtin_help.c
Functions for printing usage information of builtin commands. This
file is automatically generated from the file builtin_help.hdr and
various help files in the doc_src directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include <wchar.h>
#include <sys/types.h>
#include "config.h"
#include "util.h"
#include "common.h"
#include "builtin_help.h"
/**
Hashtable storing the help text
*/
static hash_table_t tbl;
char *builtin_help_get( wchar_t *cmd )
{
return (char *)hash_get( &tbl, (void *)cmd );
}
void builtin_help_destroy()
{
hash_destroy( &tbl );
}
void builtin_help_init()
{
hash_init( &tbl, &hash_wcs_func, &hash_wcs_cmp );

351
builtin_jobs.cpp Normal file
View File

@@ -0,0 +1,351 @@
/** \file builtin_jobs.c
Functions for executing the jobs builtin.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <unistd.h>
#include <termios.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <wctype.h>
#include "fallback.h"
#include "util.h"
#include "wutil.h"
#include "builtin.h"
#include "proc.h"
#include "parser.h"
#include "common.h"
#include "wgetopt.h"
/**
Print modes for the jobs builtin
*/
enum
{
JOBS_DEFAULT, /**< Print lots of general info */
JOBS_PRINT_PID, /**< Print pid of each process in job */
JOBS_PRINT_COMMAND, /**< Print command name of each process in job */
JOBS_PRINT_GROUP, /**< Print group id of job */
}
;
#ifdef HAVE__PROC_SELF_STAT
/**
Calculates the cpu usage (in percent) of the specified job.
*/
static int cpu_use( const job_t *j )
{
double u=0;
process_t *p;
for( p=j->first_process; p; p=p->next )
{
struct timeval t;
int jiffies;
gettimeofday( &t, 0 );
jiffies = proc_get_jiffies( p );
double t1 = 1000000.0*p->last_time.tv_sec+p->last_time.tv_usec;
double t2 = 1000000.0*t.tv_sec+t.tv_usec;
/* fwprintf( stderr, L"t1 %f t2 %f p1 %d p2 %d\n",
t1, t2, jiffies, p->last_jiffies );
*/
u += ((double)(jiffies-p->last_jiffies))/(t2-t1);
}
return u*1000000;
}
#endif
/**
Print information about the specified job
*/
static void builtin_jobs_print( const job_t *j, int mode, int header )
{
process_t *p;
switch( mode )
{
case JOBS_DEFAULT:
{
if( header )
{
/*
Print table header before first job
*/
stdout_buffer.append( _( L"Job\tGroup\t" ));
#ifdef HAVE__PROC_SELF_STAT
stdout_buffer.append( _( L"CPU\t" ) );
#endif
stdout_buffer.append( _( L"State\tCommand\n" ) );
}
append_format(stdout_buffer, L"%d\t%d\t", j->job_id, j->pgid );
#ifdef HAVE__PROC_SELF_STAT
append_format(stdout_buffer, L"%d%%\t", cpu_use(j) );
#endif
stdout_buffer.append(job_is_stopped(j)?_(L"stopped"):_(L"running"));
stdout_buffer.append(L"\t");
stdout_buffer.append(j->command_wcstr());
stdout_buffer.append(L"\t");
break;
}
case JOBS_PRINT_GROUP:
{
if( header )
{
/*
Print table header before first job
*/
stdout_buffer.append( _( L"Group\n" ));
}
append_format(stdout_buffer, L"%d\n", j->pgid );
break;
}
case JOBS_PRINT_PID:
{
if( header )
{
/*
Print table header before first job
*/
stdout_buffer.append( _( L"Procces\n" ));
}
for( p=j->first_process; p; p=p->next )
{
append_format(stdout_buffer, L"%d\n", p->pid );
}
break;
}
case JOBS_PRINT_COMMAND:
{
if( header )
{
/*
Print table header before first job
*/
stdout_buffer.append( _( L"Command\n" ));
}
for( p=j->first_process; p; p=p->next )
{
append_format(stdout_buffer, L"%ls\n", p->argv0() );
}
break;
}
}
}
/**
The jobs builtin. Used fopr printing running jobs. Defined in builtin_jobs.c.
*/
static int builtin_jobs( parser_t &parser, wchar_t **argv )
{
int argc=0;
int found=0;
int mode=JOBS_DEFAULT;
int print_last = 0;
const job_t *j;
argc = builtin_count_args( argv );
woptind=0;
while( 1 )
{
static const struct woption
long_options[] =
{
{
L"pid", no_argument, 0, 'p'
}
,
{
L"command", no_argument, 0, 'c'
}
,
{
L"group", no_argument, 0, 'g'
}
,
{
L"last", no_argument, 0, 'l'
}
,
{
L"help", no_argument, 0, 'h'
}
,
{
0, 0, 0, 0
}
}
;
int opt_index = 0;
int opt = wgetopt_long( argc,
argv,
L"pclgh",
long_options,
&opt_index );
if( opt == -1 )
break;
switch( opt )
{
case 0:
if(long_options[opt_index].flag != 0)
break;
append_format(stderr_buffer,
BUILTIN_ERR_UNKNOWN,
argv[0],
long_options[opt_index].name );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
case 'p':
mode=JOBS_PRINT_PID;
break;
case 'c':
mode=JOBS_PRINT_COMMAND;
break;
case 'g':
mode=JOBS_PRINT_GROUP;
break;
case 'l':
{
print_last = 1;
break;
}
case 'h':
builtin_print_help( parser, argv[0], stdout_buffer );
return 0;
case '?':
builtin_unknown_option( parser, argv[0], argv[woptind-1] );
return 1;
}
}
/*
Do not babble if not interactive
*/
if( builtin_out_redirect )
{
found=1;
}
if( print_last )
{
/*
Ignore unconstructed jobs, i.e. ourself.
*/
job_iterator_t jobs;
const job_t *j;
while ((j = jobs.next()))
{
if( (j->flags & JOB_CONSTRUCTED) && !job_is_completed(j) )
{
builtin_jobs_print( j, mode, !found );
return 0;
}
}
}
else
{
if( woptind < argc )
{
int i;
found = 1;
for( i=woptind; i<argc; i++ )
{
long pid;
wchar_t *end;
errno=0;
pid=wcstol( argv[i], &end, 10 );
if( errno || *end )
{
append_format(stderr_buffer,
_( L"%ls: '%ls' is not a job\n" ),
argv[0],
argv[i] );
return 1;
}
j = job_get_from_pid( pid );
if( j && !job_is_completed( j ) )
{
builtin_jobs_print( j, mode, !found );
}
else
{
append_format(stderr_buffer,
_( L"%ls: No suitable job: %d\n" ),
argv[0],
pid );
return 1;
}
}
}
else
{
job_iterator_t jobs;
const job_t *j;
while ((j = jobs.next()))
{
/*
Ignore unconstructed jobs, i.e. ourself.
*/
if( (j->flags & JOB_CONSTRUCTED) && !job_is_completed(j) )
{
builtin_jobs_print( j, mode, !found );
found = 1;
}
}
}
}
if( !found )
{
append_format(stdout_buffer,
_( L"%ls: There are no jobs\n" ),
argv[0] );
}
return 0;
}

View File

@@ -1,611 +0,0 @@
/** \file builtin_set.c Functions defining the set builtin
Functions used for implementing the set builtin.
*/
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#include <sys/types.h>
#include <termios.h>
#include <signal.h>
#include "config.h"
#include "fallback.h"
#include "util.h"
#include "wutil.h"
#include "builtin.h"
#include "env.h"
#include "expand.h"
#include "common.h"
#include "wgetopt.h"
#include "proc.h"
#include "parser.h"
#include "translate.h"
/**
Extract the name from a destination argument of the form name[index1 index2...]
*/
static int parse_fill_name( string_buffer_t *name,
const wchar_t *src)
{
if (src == 0)
{
return 0;
}
while (iswalnum(*src) || *src == L'_')
{
sb_append_char(name, *src++);
}
if (*src != L'[' && *src != L'\0')
{
sb_printf( sb_err, BUILTIN_ERR_VARCHAR, L"set", *src );
sb_append2(sb_err, parser_current_line(), L"\n", (void *)0 );
// builtin_print_help( L"set", sb_err );
return -1;
}
else
{
return 0;
}
}
/**
Extract indexes from a destination argument of the form name[index1 index2...]
*/
static int parse_fill_indexes( array_list_t *indexes,
const wchar_t *src)
{
int count = 0;
if (src == 0)
{
return 0;
}
while (*src != L'\0' && (iswalnum(*src) || *src == L'_'))
{
src++;
}
if (*src == L'\0')
{
return 0;
}
if (*src++ != L'[')
{
return -1;
}
while (iswspace(*src))
{
src++;
}
while (*src != L']')
{
wchar_t *end;
long l_ind = wcstol(src, &end, 10);
if (end == src)
{
sb_printf(sb_err, _(L"%ls: Invalid index starting at '%ls'\n"), L"set", src);
return -1;
}
int *ind = (int *) calloc(1, sizeof(int));
*ind = (int) l_ind;
al_push(indexes, ind);
src = end;
count++;
while (iswspace(*src)) src++;
}
return count;
}
/**
Update a list by writing the specified values at the specified indexes
*/
static int update_values( array_list_t *list,
array_list_t *indexes,
array_list_t *values )
{
int i;
//fwprintf(stderr, L"Scan complete\n");
/* Replace values where needed */
for( i = 0; i < al_get_count(indexes); i++ )
{
int ind = *(int *) al_get(indexes, i) - 1;
void *new = (void *) al_get(values, i);
if (al_get(list, ind) != 0)
{
free((void *) al_get(list, ind));
}
al_set(list, ind, new != 0 ? wcsdup(new) : wcsdup(L""));
}
return al_get_count(list);
}
/**
Return 1 if an array list of int* pointers contains the specified
value, 0 otherwise
*/
static int al_contains_int( array_list_t *list,
int val)
{
int i;
for (i = 0; i < al_get_count(list); i++)
{
int *current = (int *) al_get(list, i);
if (current != 0 && *current == val)
{
return 1;
}
}
return 0;
}
/**
Erase from a list values at specified indexes
*/
static int erase_values(array_list_t *list, array_list_t *indexes)
{
int i;
array_list_t result;
//fwprintf(stderr, L"Starting with %d\n", al_get_count(list));
al_init(&result);
for (i = 0; i < al_get_count(list); i++)
{
if (!al_contains_int(indexes, i + 1))
{
al_push(&result, al_get(list, i));
}
else
{
free((void *) al_get(list, i));
}
}
al_truncate(list,0);
al_push_all( list, &result );
al_destroy(&result);
//fwprintf(stderr, L"Remaining: %d\n", al_get_count(&result));
return al_get_count(list);
}
/**
Fill a string buffer with values from a list, using ARRAY_SEP_STR to separate them
*/
static int fill_buffer_from_list(string_buffer_t *sb, array_list_t *list)
{
int i;
for (i = 0; i < al_get_count(list); i++)
{
wchar_t *v = (wchar_t *) al_get(list, i);
if (v != 0)
{
// fwprintf(stderr, L".\n");
// fwprintf(stderr, L"Collecting %ls from %d\n", v, i);
sb_append(sb, v);
}
if (i < al_get_count(list) - 1)
sb_append(sb, ARRAY_SEP_STR);
}
return al_get_count(list);
}
/**
Print the names of all environment variables in the scope, with or without values,
with or without escaping
*/
static void print_variables(int include_values, int esc, int scope)
{
array_list_t names;
int i;
al_init( &names );
env_get_names( &names, scope );
sort_list( &names );
for( i = 0; i < al_get_count(&names); i++ )
{
wchar_t *key = (wchar_t *)al_get( &names, i );
wchar_t *e_key = esc ? escape(key, 1) : wcsdup(key);
sb_append(sb_out, e_key);
if( include_values )
{
wchar_t *value = env_get(key);
wchar_t *e_value;
e_value = esc ? expand_escape_variable(value) : wcsdup(value);
sb_append2(sb_out, L" ", e_value, (void *)0);
free(e_value);
}
sb_append(sb_out, L"\n");
free(e_key);
}
al_destroy(&names);
}
/**
The set builtin. Creates, updates and erases environment variables and environemnt variable arrays.
*/
int builtin_set( wchar_t **argv )
{
const static struct woption
long_options[] =
{
{
L"export", no_argument, 0, 'x'
},
{
L"global", no_argument, 0, 'g'
},
{
L"local", no_argument, 0, 'l'
},
{
L"erase", no_argument, 0, 'e'
},
{
L"names", no_argument, 0, 'n'
} ,
{
L"unexport", no_argument, 0, 'u'
} ,
{
L"universal", no_argument, 0, 'U'
} ,
{
L"query", no_argument, 0, 'q'
} ,
{
0, 0, 0, 0
}
}
;
wchar_t short_options[] = L"+xglenuUq";
int argc = builtin_count_args(argv);
/*
Flags to set the work mode
*/
int local = 0, global = 0, export = 0;
int erase = 0, list = 0, unexport=0;
int universal = 0, query=0;
/*
Variables used for performing the actual work
*/
wchar_t *dest = 0;
array_list_t values;
string_buffer_t name_sb;
int retcode=0;
wchar_t *name;
array_list_t indexes;
int retval;
/* Parse options to obtain the requested operation and the modifiers */
woptind = 0;
while (1)
{
int c = wgetopt_long(argc, argv, short_options, long_options, 0);
if (c == -1)
{
break;
}
switch(c)
{
case 0:
break;
case 'e':
erase = 1;
break;
case 'n':
list = 1;
break;
case 'x':
export = 1;
break;
case 'l':
local = 1;
break;
case 'g':
global = 1;
break;
case 'u':
unexport = 1;
break;
case 'U':
universal = 1;
break;
case 'q':
query = 1;
break;
case '?':
return 1;
default:
break;
}
}
if( query && (erase || list || global || local || universal || export || unexport ) )
{
sb_printf(sb_err,
BUILTIN_ERR_COMBO2,
argv[0],
parser_current_line() );
builtin_print_help( argv[0], sb_err );
return 1;
}
/* Check operation and modifiers sanity */
if( erase && list )
{
sb_printf(sb_err,
BUILTIN_ERR_COMBO2,
argv[0],
parser_current_line() );
builtin_print_help( argv[0], sb_err );
return 1;
}
if( local + global + universal > 1 )
{
sb_printf( sb_err,
BUILTIN_ERR_GLOCAL,
argv[0],
parser_current_line() );
builtin_print_help( argv[0], sb_err );
return 1;
}
if( export && unexport )
{
sb_printf( sb_err,
BUILTIN_ERR_EXPUNEXP,
argv[0],
parser_current_line() );
builtin_print_help( argv[0], sb_err );
return 1;
}
if( query )
{
/*
Query mode. Return number of specified variables that do not exist.
*/
int i;
for( i=woptind; i<argc; i++ )
{
if( !env_exist( argv[i] ) )
retcode++;
}
return retcode;
}
/* Parse destination */
if( woptind < argc )
{
dest = wcsdup(argv[woptind++]);
//fwprintf(stderr, L"Dest: %ls\n", dest);
if( !wcslen( dest ) )
{
free( dest );
sb_printf( sb_err, BUILTIN_ERR_VARNAME_ZERO, argv[0] );
return 1;
}
}
/* Parse values */
// wchar_t **values = woptind < argc ? (wchar_t **) calloc(argc - woptind, sizeof(wchar_t *)) : 0;
al_init(&values);
while( woptind < argc )
{
al_push(&values, argv[woptind++]);
// fwprintf(stderr, L"Val: %ls\n", argv[woptind - 1]);
}
/* Extract variable name and indexes */
sb_init(&name_sb);
retval = parse_fill_name(&name_sb, dest);
if( retval < 0 )
retcode=1;
if( !retcode )
{
name = (wchar_t *) name_sb.buff;
//fwprintf(stderr, L"Name is %ls\n", name);
al_init(&indexes);
retval = parse_fill_indexes(&indexes, dest);
if (retval < 0)
retcode = 1;
}
if( !retcode )
{
int i;
int finished=0;
/* Do the actual work */
int scope = (local ? ENV_LOCAL : 0) | (global ? ENV_GLOBAL : 0) | (export ? ENV_EXPORT : 0) | (unexport ? ENV_UNEXPORT : 0) | (universal ? ENV_UNIVERSAL:0) | ENV_USER;
if( list )
{
/* Maybe we should issue an error if there are any other arguments */
print_variables(0, 0, scope);
finished=1;
}
if( (!finished ) &&
(name == 0 || wcslen(name) == 0))
{
/* No arguments -- display name & value for all variables in scope */
if( erase )
{
sb_printf( sb_err,
_(L"%ls: Erase needs a variable name\n%ls\n"),
argv[0],
parser_current_line() );
builtin_print_help( argv[0], sb_err );
retcode = 1;
}
else
{
print_variables( 1, 1, scope );
}
finished=1;
}
if( !finished )
{
if( al_get_count( &values ) == 0 &&
al_get_count( &indexes ) == 0 &&
!erase &&
!list )
{
env_set( name, 0, scope );
finished = 1;
}
}
if( !finished )
{
/* There are some arguments, we have at least a variable name */
if( erase && al_get_count(&values) != 0 )
{
sb_printf( sb_err,
_(L"%ls: Values cannot be specfied with erase\n%ls\n"),
argv[0],
parser_current_line() );
builtin_print_help( argv[0], sb_err );
retcode = 1;
}
else
{
/* All ok, we can alter the specified variable */
array_list_t val_l;
al_init(&val_l);
void *old=0;
if (al_get_count(&indexes) == 0)
{
/* We will act upon the entire variable */
al_push( &val_l, wcsdup(L"") );
old = val_l.arr;
/* Build indexes for all variable or all new values */
int end_index = erase ? al_get_count(&val_l) : al_get_count(&values);
for (i = 0; i < end_index; i++)
{
int *ind = (int *) calloc(1, sizeof(int));
*ind = i + 1;
al_push(&indexes, ind);
}
}
else
{
/* We will act upon some specific indexes */
expand_variable_array( env_get(name), &val_l );
}
string_buffer_t result_sb;
sb_init(&result_sb);
if (erase)
{
int rem = erase_values(&val_l, &indexes);
if (rem == 0)
{
env_remove(name, ENV_USER);
}
else
{
fill_buffer_from_list(&result_sb, &val_l);
env_set(name, (wchar_t *) result_sb.buff, scope);
}
}
else
{
update_values( &val_l,
&indexes,
&values );
fill_buffer_from_list( &result_sb,
&val_l );
env_set(name,
(wchar_t *) result_sb.buff,
scope);
}
al_foreach( &val_l, (void (*)(const void *))&free );
al_destroy(&val_l);
sb_destroy(&result_sb);
}
}
al_foreach( &indexes, (void (*)(const void *))&free );
al_destroy(&indexes);
}
/* Common cleanup */
//fwprintf(stderr, L"Cleanup\n");
free(dest);
sb_destroy(&name_sb);
al_destroy( &values );
return retcode;
}

808
builtin_set.cpp Normal file
View File

@@ -0,0 +1,808 @@
/** \file builtin_set.c Functions defining the set builtin
Functions used for implementing the set builtin.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#include <sys/types.h>
#include <termios.h>
#include <signal.h>
#include <vector>
#include <algorithm>
#include "fallback.h"
#include "util.h"
#include "wutil.h"
#include "builtin.h"
#include "env.h"
#include "expand.h"
#include "common.h"
#include "wgetopt.h"
#include "proc.h"
#include "parser.h"
/* We know about these buffers */
extern wcstring stdout_buffer, stderr_buffer;
/**
Error message for invalid path operations
*/
#define BUILTIN_SET_PATH_ERROR L"%ls: Could not add component %ls to %ls.\n"
/**
Hint for invalid path operation with a colon
*/
#define BUILTIN_SET_PATH_HINT L"%ls: Did you mean 'set %ls $%ls %ls'?\n"
/**
Error for mismatch between index count and elements
*/
#define BUILTIN_SET_ARG_COUNT L"%ls: The number of variable indexes does not match the number of values\n"
/**
Test if the specified variable should be subject to path validation
*/
static int is_path_variable( const wchar_t *env )
{
return contains(env, L"PATH", L"CDPATH" );
}
/**
Call env_set. If this is a path variable, e.g. PATH, validate the
elements. On error, print a description of the problem to stderr.
*/
static int my_env_set( const wchar_t *key, wcstring_list_t &val, int scope )
{
size_t i;
int retcode = 0;
const wchar_t *val_str=NULL;
if( is_path_variable( key ) )
{
int error = 0;
for( i=0; i< val.size() ; i++ )
{
int show_perror = 0;
int show_hint = 0;
struct stat buff;
const wchar_t *dir = val[i].c_str();
if( wstat( dir, &buff ) )
{
error = 1;
show_perror = 1;
}
if( !( S_ISDIR(buff.st_mode) ) )
{
error = 1;
}
if( error )
{
const wchar_t *colon;
append_format(stderr_buffer, _(BUILTIN_SET_PATH_ERROR), L"set", dir, key);
colon = wcschr( dir, L':' );
if( colon && *(colon+1) )
{
show_hint = 1;
}
}
if( show_perror )
{
builtin_wperror( L"set" );
}
if( show_hint )
{
append_format(stderr_buffer, _(BUILTIN_SET_PATH_HINT), L"set", key, key, wcschr( dir, L':' )+1);
}
if( error )
{
break;
}
}
if( error )
{
return 1;
}
}
wcstring sb;
if( val.size() )
{
for( i=0; i< val.size() ; i++ )
{
sb.append(val[i]);
if( i<val.size() - 1 )
{
sb.append( ARRAY_SEP_STR );
}
}
val_str = sb.c_str();
}
switch( env_set( key, val_str, scope | ENV_USER ) )
{
case ENV_PERM:
{
append_format(stderr_buffer, _(L"%ls: Tried to change the read-only variable '%ls'\n"), L"set", key);
retcode=1;
break;
}
case ENV_INVALID:
{
append_format(stderr_buffer, _(L"%ls: Unknown error"), L"set" );
retcode=1;
break;
}
}
return retcode;
}
/**
Extract indexes from a destination argument of the form name[index1 index2...]
\param indexes the list to insert the new indexes into
\param src the source string to parse
\param name the name of the element. Return null if the name in \c src does not match this name
\param var_count the number of elements in the array to parse.
\return the total number of indexes parsed, or -1 on error
*/
static int parse_index( std::vector<long> &indexes,
const wchar_t *src,
const wchar_t *name,
int var_count )
{
size_t len;
int count = 0;
const wchar_t *src_orig = src;
if (src == 0)
{
return 0;
}
while (*src != L'\0' && (iswalnum(*src) || *src == L'_'))
{
src++;
}
if (*src != L'[')
{
append_format(stderr_buffer, _(BUILTIN_SET_ARG_COUNT), L"set" );
return 0;
}
len = src-src_orig;
if( (wcsncmp( src_orig, name, len )!=0) || (wcslen(name) != (len)) )
{
append_format(stderr_buffer,
_(L"%ls: Multiple variable names specified in single call (%ls and %.*ls)\n"),
L"set",
name,
len,
src_orig);
return 0;
}
src++;
while (iswspace(*src))
{
src++;
}
while (*src != L']')
{
wchar_t *end;
long l_ind;
errno = 0;
l_ind = wcstol(src, &end, 10);
if( end==src || errno )
{
append_format(stderr_buffer, _(L"%ls: Invalid index starting at '%ls'\n"), L"set", src);
return 0;
}
if( l_ind < 0 )
{
l_ind = var_count+l_ind+1;
}
indexes.push_back( l_ind );
src = end;
count++;
while (iswspace(*src)) src++;
}
return count;
}
static int update_values( wcstring_list_t &list,
std::vector<long> &indexes,
wcstring_list_t &values )
{
size_t i;
/* Replace values where needed */
for( i = 0; i < indexes.size(); i++ )
{
/*
The '- 1' below is because the indices in fish are
one-based, but the vector uses zero-based indices
*/
long ind = indexes[i] - 1;
const wcstring newv = values[ i ];
if( ind < 0 )
{
return 1;
}
// free((void *) al_get(list, ind));
list[ ind ] = newv;
}
return 0;
}
/**
Erase from a list of wcstring values at specified indexes
*/
static void erase_values(wcstring_list_t &list, const std::vector<long> &indexes)
{
// Make a set of indexes.
// This both sorts them into ascending order and removes duplicates.
const std::set<long> indexes_set(indexes.begin(), indexes.end());
// Now walk the set backwards, so we encounter larger indexes first, and remove elements at the given (1-based) indexes.
std::set<long>::const_reverse_iterator iter;
for (iter = indexes_set.rbegin(); iter != indexes_set.rend(); iter++) {
long val = *iter;
if (val > 0 && val <= list.size()) {
// One-based indexing!
list.erase(list.begin() + val - 1);
}
}
}
/**
Print the names of all environment variables in the scope, with or without shortening,
with or without values, with or without escaping
*/
static void print_variables(int include_values, int esc, bool shorten_ok, int scope)
{
wcstring_list_t names = env_get_names(scope);
sort(names.begin(), names.end());
for( size_t i = 0; i < names.size(); i++ )
{
const wcstring key = names.at(i);
const wcstring e_key = escape_string(key, 0);
stdout_buffer.append(e_key);
if( include_values )
{
env_var_t value = env_get_string(key);
if( !value.missing() )
{
int shorten = 0;
if( shorten_ok && value.length() > 64 )
{
shorten = 1;
value.resize(60);
}
wcstring e_value = esc ? expand_escape_variable(value) : value;
stdout_buffer.append(L" ");
stdout_buffer.append(e_value);
if( shorten )
{
stdout_buffer.append(L"\u2026");
}
}
}
stdout_buffer.append(L"\n");
}
}
/**
The set builtin. Creates, updates and erases environment variables
and environemnt variable arrays.
*/
static int builtin_set( parser_t &parser, wchar_t **argv )
{
/**
Variables used for parsing the argument list
*/
static const struct woption
long_options[] =
{
{
L"export", no_argument, 0, 'x'
}
,
{
L"global", no_argument, 0, 'g'
}
,
{
L"local", no_argument, 0, 'l'
}
,
{
L"erase", no_argument, 0, 'e'
}
,
{
L"names", no_argument, 0, 'n'
}
,
{
L"unexport", no_argument, 0, 'u'
}
,
{
L"universal", no_argument, 0, 'U'
}
,
{
L"long", no_argument, 0, 'L'
}
,
{
L"query", no_argument, 0, 'q'
}
,
{
L"help", no_argument, 0, 'h'
}
,
{
0, 0, 0, 0
}
}
;
const wchar_t *short_options = L"+xglenuULqh";
int argc = builtin_count_args(argv);
/*
Flags to set the work mode
*/
int local = 0, global = 0, exportv = 0;
int erase = 0, list = 0, unexport=0;
int universal = 0, query=0;
bool shorten_ok = true;
/*
Variables used for performing the actual work
*/
wchar_t *dest = 0;
int retcode=0;
int scope;
int slice=0;
int i;
wchar_t *bad_char;
/* Parse options to obtain the requested operation and the modifiers */
woptind = 0;
while (1)
{
int c = wgetopt_long(argc, argv, short_options, long_options, 0);
if (c == -1)
{
break;
}
switch(c)
{
case 0:
break;
case 'e':
erase = 1;
break;
case 'n':
list = 1;
break;
case 'x':
exportv = 1;
break;
case 'l':
local = 1;
break;
case 'g':
global = 1;
break;
case 'u':
unexport = 1;
break;
case 'U':
universal = 1;
break;
case 'L':
shorten_ok = false;
break;
case 'q':
query = 1;
break;
case 'h':
builtin_print_help( parser, argv[0], stdout_buffer );
return 0;
case '?':
builtin_unknown_option( parser, argv[0], argv[woptind-1] );
return 1;
default:
break;
}
}
/*
Ok, all arguments have been parsed, let's validate them
*/
/*
If we are checking the existance of a variable (-q) we can not
also specify scope
*/
if( query && (erase || list || global || local || universal || exportv || unexport ) )
{
append_format(stderr_buffer,
BUILTIN_ERR_COMBO,
argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
/* We can't both list and erase varaibles */
if( erase && list )
{
append_format(stderr_buffer,
BUILTIN_ERR_COMBO,
argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
/*
Variables can only have one scope
*/
if( local + global + universal > 1 )
{
append_format(stderr_buffer,
BUILTIN_ERR_GLOCAL,
argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
/*
Variables can only have one export status
*/
if( exportv && unexport )
{
append_format(stderr_buffer,
BUILTIN_ERR_EXPUNEXP,
argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
/*
Calculate the scope value for variable assignement
*/
scope = (local ? ENV_LOCAL : 0) | (global ? ENV_GLOBAL : 0) | (exportv ? ENV_EXPORT : 0) | (unexport ? ENV_UNEXPORT : 0) | (universal ? ENV_UNIVERSAL:0) | ENV_USER;
if( query )
{
/*
Query mode. Return the number of variables that do not exist
out of the specified variables.
*/
int i;
for( i=woptind; i<argc; i++ )
{
wchar_t *arg = argv[i];
int slice=0;
if( !(dest = wcsdup(arg)))
{
DIE_MEM();
}
if( wcschr( dest, L'[' ) )
{
slice = 1;
*wcschr( dest, L'[' )=0;
}
if( slice )
{
std::vector<long> indexes;
wcstring_list_t result;
size_t j;
env_var_t dest_str = env_get_string(dest);
if (! dest_str.missing())
tokenize_variable_array( dest_str, result );
if( !parse_index( indexes, arg, dest, result.size() ) )
{
builtin_print_help( parser, argv[0], stderr_buffer );
retcode = 1;
break;
}
for( j=0; j < indexes.size() ; j++ )
{
long idx = indexes[j];
if( idx < 1 || (size_t)idx > result.size() )
{
retcode++;
}
}
}
else
{
if( !env_exist( arg, scope ) )
{
retcode++;
}
}
free( dest );
}
return retcode;
}
if( list )
{
/* Maybe we should issue an error if there are any other arguments? */
print_variables(0, 0, shorten_ok, scope);
return 0;
}
if( woptind == argc )
{
/*
Print values of variables
*/
if( erase )
{
append_format(stderr_buffer,
_(L"%ls: Erase needs a variable name\n%ls\n"),
argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
retcode = 1;
}
else
{
print_variables( 1, 1, shorten_ok, scope );
}
return retcode;
}
if( !(dest = wcsdup(argv[woptind])))
{
DIE_MEM();
}
if( wcschr( dest, L'[' ) )
{
slice = 1;
*wcschr( dest, L'[' )=0;
}
if( !wcslen( dest ) )
{
free( dest );
append_format(stderr_buffer, BUILTIN_ERR_VARNAME_ZERO, argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
if( (bad_char = wcsvarname( dest ) ) )
{
append_format(stderr_buffer, BUILTIN_ERR_VARCHAR, argv[0], *bad_char );
builtin_print_help( parser, argv[0], stderr_buffer );
free( dest );
return 1;
}
if( slice && erase && (scope != ENV_USER) )
{
free( dest );
append_format(stderr_buffer, _(L"%ls: Can not specify scope when erasing array slice\n"), argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
/*
set assignment can work in two modes, either using slices or
using the whole array. We detect which mode is used here.
*/
if( slice )
{
/*
Slice mode
*/
int idx_count, val_count;
wcstring_list_t values;
std::vector<long> indexes;
wcstring_list_t result;
const env_var_t dest_str = env_get_string(dest);
if (! dest_str.missing())
tokenize_variable_array( dest_str, result );
for( ; woptind<argc; woptind++ )
{
if( !parse_index( indexes, argv[woptind], dest, result.size() ) )
{
builtin_print_help( parser, argv[0], stderr_buffer );
retcode = 1;
break;
}
val_count = argc-woptind-1;
idx_count = indexes.size();
if( !erase )
{
if( val_count < idx_count )
{
append_format(stderr_buffer, _(BUILTIN_SET_ARG_COUNT), argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
retcode=1;
break;
}
if( val_count == idx_count )
{
woptind++;
break;
}
}
}
if( !retcode )
{
/*
Slice indexes have been calculated, do the actual work
*/
if( erase )
{
erase_values(result, indexes);
my_env_set( dest, result, scope);
}
else
{
wcstring_list_t value;
// al_init(&value);
while( woptind < argc )
{
value.push_back( argv[woptind++] );
}
if( update_values( result,
indexes,
value ) )
{
append_format(stderr_buffer, L"%ls: ", argv[0] );
append_format(stderr_buffer, ARRAY_BOUNDS_ERR );
stderr_buffer.push_back(L'\n');
}
my_env_set(dest, result, scope);
// al_destroy( &value );
}
}
// al_foreach( &result, &free );
// al_destroy( &result );
// al_destroy(&indexes);
// al_destroy(&values);
}
else
{
woptind++;
/*
No slicing
*/
if( erase )
{
if( woptind != argc )
{
append_format(stderr_buffer,
_(L"%ls: Values cannot be specfied with erase\n"),
argv[0] );
builtin_print_help( parser, argv[0], stderr_buffer );
retcode=1;
}
else
{
retcode = env_remove( dest, scope );
}
}
else
{
wcstring_list_t val;
for( i=woptind; i<argc; i++ )
val.push_back(argv[i]);
retcode = my_env_set( dest, val, scope );
}
}
free( dest );
return retcode;
}

745
builtin_test.cpp Normal file
View File

@@ -0,0 +1,745 @@
/** \file builtin_test.cpp Functions defining the test builtin
Functions used for implementing the test builtin.
Implemented from scratch (yes, really) by way of IEEE 1003.1 as reference.
*/
#include "config.h"
#include "common.h"
#include "builtin.h"
#include "wutil.h"
#include "proc.h"
#include <sys/stat.h>
#include <memory>
enum {
BUILTIN_TEST_SUCCESS = STATUS_BUILTIN_OK,
BUILTIN_TEST_FAIL = STATUS_BUILTIN_ERROR
};
int builtin_test( parser_t &parser, wchar_t **argv );
static const wchar_t * const condstr[] = {
L"!", L"&&", L"||", L"==", L"!=", L"<", L">", L"-nt", L"-ot", L"-ef", L"-eq",
L"-ne", L"-lt", L"-gt", L"-le", L"-ge", L"=~"
};
namespace test_expressions {
enum token_t {
test_unknown, // arbitrary string
test_bang, // "!", inverts sense
test_filetype_b, // "-b", for block special files
test_filetype_c, // "-c" for character special files
test_filetype_d, // "-d" for directories
test_filetype_e, // "-e" for files that exist
test_filetype_f, // "-f" for for regular files
test_filetype_g, // "-g" for set-group-id
test_filetype_h, // "-h" for symbolic links
test_filetype_L, // "-L", same as -h
test_filetype_p, // "-p", for FIFO
test_filetype_S, // "-S", socket
test_filesize_s, // "-s", size greater than zero
test_filedesc_t, // "-t", whether the fd is associated with a terminal
test_fileperm_r, // "-r", read permission
test_fileperm_u, // "-u", whether file is setuid
test_fileperm_w, // "-w", whether file write permission is allowed
test_fileperm_x, // "-x", whether file execute/search is allowed
test_string_n, // "-n", non-empty string
test_string_z, // "-z", true if length of string is 0
test_string_equal, // "=", true if strings are identical
test_string_not_equal, // "!=", true if strings are not identical
test_number_equal, // "-eq", true if numbers are equal
test_number_not_equal, // "-ne", true if numbers are not equal
test_number_greater, // "-gt", true if first number is larger than second
test_number_greater_equal, // "-ge", true if first number is at least second
test_number_lesser, // "-lt", true if first number is smaller than second
test_number_lesser_equal, // "-le", true if first number is at most second
test_combine_and, // "-a", true if left and right are both true
test_combine_or, // "-o", true if either left or right is true
test_paren_open, // "(", open paren
test_paren_close, // ")", close paren
};
static bool binary_primary_evaluate(test_expressions::token_t token, const wcstring &left, const wcstring &right, wcstring_list_t &errors);
static bool unary_primary_evaluate(test_expressions::token_t token, const wcstring &arg, wcstring_list_t &errors);
enum {
UNARY_PRIMARY = 1 << 0,
BINARY_PRIMARY = 1 << 1
};
static const struct token_info_t { token_t tok; const wchar_t *string; unsigned int flags; } token_infos[] =
{
{test_unknown, L"", 0},
{test_bang, L"!", 0},
{test_filetype_b, L"-b", UNARY_PRIMARY},
{test_filetype_c, L"-c", UNARY_PRIMARY},
{test_filetype_d, L"-d", UNARY_PRIMARY},
{test_filetype_e, L"-e", UNARY_PRIMARY},
{test_filetype_f, L"-f", UNARY_PRIMARY},
{test_filetype_g, L"-g", UNARY_PRIMARY},
{test_filetype_h, L"-h", UNARY_PRIMARY},
{test_filetype_L, L"-L", UNARY_PRIMARY},
{test_filetype_p, L"-p", UNARY_PRIMARY},
{test_filetype_S, L"-S", UNARY_PRIMARY},
{test_filesize_s, L"-s", UNARY_PRIMARY},
{test_filedesc_t, L"-t", UNARY_PRIMARY},
{test_fileperm_r, L"-r", UNARY_PRIMARY},
{test_fileperm_u, L"-u", UNARY_PRIMARY},
{test_fileperm_w, L"-w", UNARY_PRIMARY},
{test_fileperm_x, L"-x", UNARY_PRIMARY},
{test_string_n, L"-n", UNARY_PRIMARY},
{test_string_z, L"-z", UNARY_PRIMARY},
{test_string_equal, L"=", BINARY_PRIMARY},
{test_string_not_equal, L"!=", BINARY_PRIMARY},
{test_number_equal, L"-eq", BINARY_PRIMARY},
{test_number_not_equal, L"-ne", BINARY_PRIMARY},
{test_number_greater, L"-gt", BINARY_PRIMARY},
{test_number_greater_equal, L"-ge", BINARY_PRIMARY},
{test_number_lesser, L"-lt", BINARY_PRIMARY},
{test_number_lesser_equal, L"-le", BINARY_PRIMARY},
{test_combine_and, L"-a", 0},
{test_combine_or, L"-o", 0},
{test_paren_open, L"(", 0},
{test_paren_close, L")", 0}
};
const token_info_t *token_for_string(const wcstring &str) {
for (size_t i=0; i < sizeof token_infos / sizeof *token_infos; i++) {
if (str == token_infos[i].string) {
return &token_infos[i];
}
}
return &token_infos[0]; //unknown
}
/* Grammar.
<expr> = <combining_expr>
<combining_expr> = <unary_expr> and/or <combining_expr> |
<unary_expr>
<unary_expr> = bang <unary_expr> |
<primary>
<primary> = <unary_primary> arg |
arg <binary_primary> arg |
'(' <expr> ')'
*/
class expression;
class test_parser {
private:
wcstring_list_t strings;
wcstring_list_t errors;
expression *error(const wchar_t *fmt, ...);
void add_error(const wchar_t *fmt, ...);
const wcstring &arg(unsigned int idx) { return strings.at(idx); }
public:
test_parser(const wcstring_list_t &val) : strings(val)
{ }
expression *parse_expression(unsigned int start, unsigned int end);
expression *parse_combining_expression(unsigned int start, unsigned int end);
expression *parse_unary_expression(unsigned int start, unsigned int end);
expression *parse_primary(unsigned int start, unsigned int end);
expression *parse_parenthentical(unsigned int start, unsigned int end);
expression *parse_unary_primary(unsigned int start, unsigned int end);
expression *parse_binary_primary(unsigned int start, unsigned int end);
expression *parse_just_a_string(unsigned int start, unsigned int end);
static expression *parse_args(const wcstring_list_t &args, wcstring &err);
};
struct range_t {
unsigned int start;
unsigned int end;
range_t(unsigned s, unsigned e) : start(s), end(e) { }
};
/* Base class for expressions */
class expression {
protected:
expression(token_t what, range_t where) : token(what), range(where) { }
public:
const token_t token;
range_t range;
virtual ~expression() { }
// evaluate returns true if the expression is true (i.e. BUILTIN_TEST_SUCCESS)
virtual bool evaluate(wcstring_list_t &errors) = 0;
};
typedef std::auto_ptr<expression> expr_ref_t;
/* Single argument like -n foo or "just a string" */
class unary_primary : public expression {
public:
wcstring arg;
unary_primary(token_t tok, range_t where, const wcstring &what) : expression(tok, where), arg(what) { }
bool evaluate(wcstring_list_t &errors);
};
/* Two argument primary like foo != bar */
class binary_primary : public expression {
public:
wcstring arg_left;
wcstring arg_right;
binary_primary(token_t tok, range_t where, const wcstring &left, const wcstring &right) : expression(tok, where), arg_left(left), arg_right(right)
{ }
bool evaluate(wcstring_list_t &errors);
};
/* Unary operator like bang */
class unary_operator : public expression {
public:
expr_ref_t subject;
unary_operator(token_t tok, range_t where, expr_ref_t &exp) : expression(tok, where), subject(exp) { }
bool evaluate(wcstring_list_t &errors);
};
/* Combining expression. Contains a list of AND or OR expressions. It takes more than two so that we don't have to worry about precedence in the parser. */
class combining_expression : public expression {
public:
const std::vector<expression *> subjects;
const std::vector<token_t> combiners;
combining_expression(token_t tok, range_t where, const std::vector<expression *> &exprs, const std::vector<token_t> &combs) : expression(tok, where), subjects(exprs), combiners(combs)
{
/* We should have one more subject than combiner */
assert(subjects.size() == combiners.size() + 1);
}
/* We are responsible for destroying our expressions */
virtual ~combining_expression() {
for (size_t i=0; i < subjects.size(); i++) {
delete subjects[i];
}
}
bool evaluate(wcstring_list_t &errors);
};
/* Parenthetical expression */
class parenthetical_expression : public expression {
public:
expr_ref_t contents;
parenthetical_expression(token_t tok, range_t where, expr_ref_t &expr) : expression(tok, where), contents(expr) { }
virtual bool evaluate(wcstring_list_t &errors);
};
void test_parser::add_error(const wchar_t *fmt, ...) {
assert(fmt != NULL);
va_list va;
va_start(va, fmt);
this->errors.push_back(vformat_string(fmt, va));
va_end(va);
}
expression *test_parser::error(const wchar_t *fmt, ...) {
assert(fmt != NULL);
va_list va;
va_start(va, fmt);
this->errors.push_back(vformat_string(fmt, va));
va_end(va);
return NULL;
}
expression *test_parser::parse_unary_expression(unsigned int start, unsigned int end) {
if (start >= end) {
return error(L"Missing argument at index %u", start);
}
token_t tok = token_for_string(arg(start))->tok;
if (tok == test_bang) {
expr_ref_t subject(parse_unary_expression(start + 1, end));
if (subject.get()) {
return new unary_operator(tok, range_t(start, subject->range.end), subject);
} else {
return NULL;
}
} else {
return parse_primary(start, end);
}
}
/* Parse a combining expression (AND, OR) */
expression *test_parser::parse_combining_expression(unsigned int start, unsigned int end) {
if (start >= end)
return NULL;
std::vector<expression *> subjects;
std::vector<token_t> combiners;
unsigned int idx = start;
while (idx < end) {
if (! subjects.empty()) {
/* This is not the first expression, so we expect a combiner. */
token_t combiner = token_for_string(arg(idx))->tok;
if (combiner != test_combine_and && combiner != test_combine_or) {
/* Not a combiner, we're done */
break;
}
combiners.push_back(combiner);
idx++;
}
/* Parse another expression */
expression *expr = parse_unary_expression(idx, end);
if (! expr) {
add_error(L"Missing argument at index %u", idx);
break;
}
/* Go to the end of this expression */
idx = expr->range.end;
subjects.push_back(expr);
}
if (! subjects.empty()) {
/* Our new expression takes ownership of all expressions we created. The token we pass is irrelevant. */
return new combining_expression(test_combine_and, range_t(start, idx), subjects, combiners);
} else {
/* No subjects */
return NULL;
}
}
expression *test_parser::parse_unary_primary(unsigned int start, unsigned int end) {
/* We need two arguments */
if (start >= end) {
return error(L"Missing argument at index %u", start);
}
if (start + 1 >= end) {
return error(L"Missing argument at index %u", start + 1);
}
/* All our unary primaries are prefix, so the operator is at start. */
const token_info_t *info = token_for_string(arg(start));
if (! (info->flags & UNARY_PRIMARY))
return NULL;
return new unary_primary(info->tok, range_t(start, start + 2), arg(start + 1));
}
expression *test_parser::parse_just_a_string(unsigned int start, unsigned int end) {
/* Handle a string as a unary primary that is not a token of any other type.
e.g. 'test foo -a bar' should evaluate to true
We handle this with a unary primary of test_string_n
*/
/* We need one arguments */
if (start >= end) {
return error(L"Missing argument at index %u", start);
}
const token_info_t *info = token_for_string(arg(start));
if (info->tok != test_unknown) {
return error(L"Unexpected argument type at index %u", start);
}
/* This is hackish; a nicer way to implement this would be with a "just a string" expression type */
return new unary_primary(test_string_n, range_t(start, start + 1), arg(start));
}
#if 0
expression *test_parser::parse_unary_primary(unsigned int start, unsigned int end) {
/* We need either one or two arguments */
if (start >= end) {
return error(L"Missing argument at index %u", start);
}
/* The index of the argument to the unary primary */
unsigned int arg_idx;
/* All our unary primaries are prefix, so any operator is at start. But it also may just be a string, with no operator. */
const token_info_t *info = token_for_string(arg(start));
if (info->flags & UNARY_PRIMARY) {
/* We have an operator. Skip the operator argument */
arg_idx = start + 1;
/* We have some freedom here...do we allow other tokens for the argument to operate on?
For example, should 'test -n =' work? I say yes. So no typechecking on the next token. */
} else if (info->tok == test_unknown) {
/* "Just a string. */
arg_idx = start;
} else {
/* Here we don't allow arbitrary tokens as "just a string." I.e. 'test = -a =' should have a parse error. We could relax this at some point. */
return error(L"Parse error at argument index %u", start);
}
/* Verify we have the argument we want, i.e. test -n should fail to parse */
if (arg_idx >= end) {
return error(L"Missing argument at index %u", arg_idx);
}
return new unary_primary(info->tok, range_t(start, arg_idx + 1), arg(arg_idx));
}
#endif
expression *test_parser::parse_binary_primary(unsigned int start, unsigned int end) {
/* We need three arguments */
for (unsigned int idx = start; idx < start + 3; idx++) {
if (idx >= end) {
return error(L"Missing argument at index %u", idx);
}
}
/* All our binary primaries are infix, so the operator is at start + 1. */
const token_info_t *info = token_for_string(arg(start + 1));
if (! (info->flags & BINARY_PRIMARY))
return NULL;
return new binary_primary(info->tok, range_t(start, start + 3), arg(start), arg(start + 2));
}
expression *test_parser::parse_parenthentical(unsigned int start, unsigned int end) {
/* We need at least three arguments: open paren, argument, close paren */
if (start + 3 >= end)
return NULL;
/* Must start with an open expression */
const token_info_t *open_paren = token_for_string(arg(start));
if (open_paren->tok != test_paren_open)
return NULL;
/* Parse a subexpression */
expression *subexr_ptr = parse_expression(start + 1, end);
if (! subexr_ptr)
return NULL;
expr_ref_t subexpr(subexr_ptr);
/* Parse a close paren */
unsigned close_index = subexpr->range.end;
assert(close_index <= end);
if (close_index == end) {
return error(L"Missing close paren at index %u", close_index);
}
const token_info_t *close_paren = token_for_string(arg(close_index));
if (close_paren->tok != test_paren_close) {
return error(L"Expected close paren at index %u", close_index);
}
/* Success */
return new parenthetical_expression(test_paren_open, range_t(start, close_index+1), subexpr);
}
expression *test_parser::parse_primary(unsigned int start, unsigned int end) {
if (start >= end) {
return error(L"Missing argument at index %u", start);
}
expression *expr = NULL;
if (! expr) expr = parse_parenthentical(start, end);
if (! expr) expr = parse_unary_primary(start, end);
if (! expr) expr = parse_binary_primary(start, end);
if (! expr) expr = parse_just_a_string(start, end);
return expr;
}
expression *test_parser::parse_expression(unsigned int start, unsigned int end) {
if (start >= end) {
return error(L"Missing argument at index %u", start);
}
return parse_combining_expression(start, end);
}
expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err) {
/* Empty list and one-arg list should be handled by caller */
assert(args.size() > 1);
test_parser parser(args);
expression *result = parser.parse_expression(0, (unsigned int)args.size());
/* Handle errors */
bool errored = false;
for (size_t i = 0; i < parser.errors.size(); i++) {
err.append(L"test: ");
err.append(parser.errors.at(i));
err.push_back(L'\n');
errored = true;
// For now we only show the first error
break;
}
if (! errored && result) {
/* It's also an error if there are any unused arguments. This is not detected by parse_expression() */
assert(result->range.end <= args.size());
if (result->range.end < args.size()) {
append_format(err, L"test: unexpected argument at index %lu: '%ls'\n", (unsigned long)result->range.end, args.at(result->range.end).c_str());
delete result;
result = NULL;
errored = true;
}
}
return result;
}
bool unary_primary::evaluate(wcstring_list_t &errors) {
return unary_primary_evaluate(token, arg, errors);
}
bool binary_primary::evaluate(wcstring_list_t &errors) {
return binary_primary_evaluate(token, arg_left, arg_right, errors);
}
bool unary_operator::evaluate(wcstring_list_t &errors) {
switch (token) {
case test_bang:
assert(subject.get());
return ! subject->evaluate(errors);
default:
errors.push_back(format_string(L"Unknown token type in %s", __func__));
return false;
}
}
bool combining_expression::evaluate(wcstring_list_t &errors) {
switch (token) {
case test_combine_and:
case test_combine_or:
{
/* One-element case */
if (subjects.size() == 1)
return subjects.at(0)->evaluate(errors);
/* Evaluate our lists, remembering that AND has higher precedence than OR. We can visualize this as a sequence of OR expressions of AND expressions. */
assert(combiners.size() + 1 == subjects.size());
assert(! subjects.empty());
size_t idx = 0, max = subjects.size();
bool or_result = false;
while (idx < max) {
if (or_result) {
/* Short circuit */
break;
}
/* Evaluate a stream of AND starting at given subject index. It may only have one element. */
bool and_result = true;
for (; idx < max; idx++) {
/* Evaluate it, short-circuiting */
and_result = and_result && subjects.at(idx)->evaluate(errors);
/* If the combiner at this index (which corresponding to how we combine with the next subject) is not AND, then exit the loop */
if (idx + 1 < max && combiners.at(idx) != test_combine_and) {
idx++;
break;
}
}
/* OR it in */
or_result = or_result || and_result;
}
return or_result;
}
default:
errors.push_back(format_string(L"Unknown token type in %s", __func__));
return BUILTIN_TEST_FAIL;
}
}
bool parenthetical_expression::evaluate(wcstring_list_t &errors) {
return contents->evaluate(errors);
}
/* IEEE 1003.1 says nothing about what it means for two strings to be "algebraically equal". For example, should we interpret 0x10 as 0, 10, or 16? Here we use only base 10 and use wcstoll, which allows for leading + and -, and leading whitespace. This matches bash. */
static bool parse_number(const wcstring &arg, long long *out) {
const wchar_t *str = arg.c_str();
wchar_t *endptr = NULL;
*out = wcstoll(str, &endptr, 10);
return endptr && *endptr == L'\0';
}
static bool binary_primary_evaluate(test_expressions::token_t token, const wcstring &left, const wcstring &right, wcstring_list_t &errors) {
using namespace test_expressions;
long long left_num, right_num;
switch (token) {
case test_string_equal:
return left == right;
case test_string_not_equal:
return left != right;
case test_number_equal:
return parse_number(left, &left_num) && parse_number(right, &right_num) && left_num == right_num;
case test_number_not_equal:
return parse_number(left, &left_num) && parse_number(right, &right_num) && left_num != right_num;
case test_number_greater:
return parse_number(left, &left_num) && parse_number(right, &right_num) && left_num > right_num;
case test_number_greater_equal:
return parse_number(left, &left_num) && parse_number(right, &right_num) && left_num >= right_num;
case test_number_lesser:
return parse_number(left, &left_num) && parse_number(right, &right_num) && left_num < right_num;
case test_number_lesser_equal:
return parse_number(left, &left_num) && parse_number(right, &right_num) && left_num <= right_num;
default:
errors.push_back(format_string(L"Unknown token type in %s", __func__));
return false;
}
}
static bool unary_primary_evaluate(test_expressions::token_t token, const wcstring &arg, wcstring_list_t &errors) {
using namespace test_expressions;
struct stat buf;
long long num;
switch (token) {
case test_filetype_b: // "-b", for block special files
return !wstat(arg, &buf) && S_ISBLK(buf.st_mode);
case test_filetype_c: // "-c" for character special files
return !wstat(arg, &buf) && S_ISCHR(buf.st_mode);
case test_filetype_d: // "-d" for directories
return !wstat(arg, &buf) && S_ISDIR(buf.st_mode);
case test_filetype_e: // "-e" for files that exist
return !wstat(arg, &buf);
case test_filetype_f: // "-f" for for regular files
return !wstat(arg, &buf) && S_ISREG(buf.st_mode);
case test_filetype_g: // "-g" for set-group-id
return !wstat(arg, &buf) && (S_ISGID & buf.st_mode);
case test_filetype_h: // "-h" for symbolic links
case test_filetype_L: // "-L", same as -h
return !lwstat(arg, &buf) && S_ISLNK(buf.st_mode);
case test_filetype_p: // "-p", for FIFO
return !wstat(arg, &buf) && S_ISFIFO(buf.st_mode);
case test_filetype_S: // "-S", socket
return !wstat(arg, &buf) && S_ISSOCK(buf.st_mode);
case test_filesize_s: // "-s", size greater than zero
return !wstat(arg, &buf) && buf.st_size > 0;
case test_filedesc_t: // "-t", whether the fd is associated with a terminal
return parse_number(arg, &num) && num == (int)num && isatty((int)num);
case test_fileperm_r: // "-r", read permission
return !waccess(arg, R_OK);
case test_fileperm_u: // "-u", whether file is setuid
return !wstat(arg, &buf) && (S_ISUID & buf.st_mode);
case test_fileperm_w: // "-w", whether file write permission is allowed
return !waccess(arg, W_OK);
case test_fileperm_x: // "-x", whether file execute/search is allowed
return !waccess(arg, X_OK);
case test_string_n: // "-n", non-empty string
return ! arg.empty();
case test_string_z: // "-z", true if length of string is 0
return arg.empty();
default:
errors.push_back(format_string(L"Unknown token type in %s", __func__));
return false;
}
}
};
/*
* Evaluate a conditional expression given the arguments.
* If fromtest is set, the caller is the test or [ builtin;
* with the pointer giving the name of the command.
* for POSIX conformance this supports a more limited range
* of functionality.
*
* Return status is the final shell status, i.e. 0 for true,
* 1 for false and 2 for error.
*/
int builtin_test( parser_t &parser, wchar_t **argv )
{
using namespace test_expressions;
/* The first argument should be the name of the command ('test') */
if (! argv[0])
return BUILTIN_TEST_FAIL;
size_t argc = 0;
while (argv[argc + 1])
argc++;
const wcstring_list_t args(argv + 1, argv + 1 + argc);
if (argc == 0) {
// Per 1003.1, exit false
return BUILTIN_TEST_FAIL;
} else if (argc == 1) {
// Per 1003.1, exit true if the arg is non-empty
return args.at(0).empty() ? BUILTIN_TEST_FAIL : BUILTIN_TEST_SUCCESS;
} else {
// Try parsing. If expr is not nil, we are responsible for deleting it.
wcstring err;
expression *expr = test_parser::parse_args(args, err);
if (! expr) {
#if 0
printf("Oops! test was given args:\n");
for (size_t i=0; i < argc; i++) {
printf("\t%ls\n", args.at(i).c_str());
}
printf("and returned parse error: %ls\n", err.c_str());
#endif
builtin_show_error(err);
return BUILTIN_TEST_FAIL;
} else {
wcstring_list_t eval_errors;
bool result = expr->evaluate(eval_errors);
if (! eval_errors.empty()) {
printf("test returned eval errors:\n");
for (size_t i=0; i < eval_errors.size(); i++) {
printf("\t%ls\n", eval_errors.at(i).c_str());
}
}
delete expr;
return result ? BUILTIN_TEST_SUCCESS : BUILTIN_TEST_FAIL;
}
}
return 1;
}

View File

@@ -20,7 +20,7 @@ Functions used for implementing the ulimit builtin.
#include "builtin.h"
#include "common.h"
#include "wgetopt.h"
#include "translate.h"
/**
Struct describing a resource limit
@@ -49,7 +49,7 @@ struct resource_t
/**
Array of resource_t structs, describing all known resource types.
*/
const static struct resource_t resource_arr[] =
static const struct resource_t resource_arr[] =
{
{
RLIMIT_CORE, L"Maximum size of core files created", L'c', 1024
@@ -63,13 +63,13 @@ const static struct resource_t resource_arr[] =
RLIMIT_FSIZE, L"Maximum size of files created by the shell", L'f', 1024
}
,
#if HAVE_RLIMIT_MEMLOCK
#ifdef RLIMIT_MEMLOCK
{
RLIMIT_MEMLOCK, L"Maximum size that may be locked into memory", L'l', 1024
}
,
#endif
#if HAVE_RLIMIT_RSS
#ifdef RLIMIT_RSS
{
RLIMIT_RSS, L"Maximum resident set size", L'm', 1024
}
@@ -87,13 +87,13 @@ const static struct resource_t resource_arr[] =
RLIMIT_CPU, L"Maximum amount of cpu time in seconds", L't', 1
}
,
#if HAVE_RLIMIT_NPROC
#ifdef RLIMIT_NPROC
{
RLIMIT_NPROC, L"Maximum number of processes available to a single user", L'u', 1
}
,
#endif
#if HAVE_RLIMIT_AS
#ifdef RLIMIT_AS
{
RLIMIT_AS, L"Maximum amount of virtual memory available to the shell", L'v', 1024
}
@@ -123,7 +123,9 @@ static int get_multiplier( int what )
}
/**
Return the value for the specified resource limit
Return the value for the specified resource limit. This function
does _not_ multiply the limit value by the multiplier constant used
by the commandline ulimit.
*/
static rlim_t get( int resource, int hard )
{
@@ -142,9 +144,9 @@ static void print( int resource, int hard )
rlim_t l = get( resource, hard );
if( l == RLIM_INFINITY )
sb_append( sb_out, L"unlimited\n" );
stdout_buffer.append( L"unlimited\n" );
else
sb_printf( sb_out, L"%d\n", l );
append_format(stdout_buffer, L"%d\n", l / get_multiplier( resource ) );
}
@@ -168,9 +170,9 @@ static void print_all( int hard )
getrlimit( resource_arr[i].resource, &ls );
l = hard ? ls.rlim_max:ls.rlim_cur;
wchar_t *unit = ((resource_arr[i].resource==RLIMIT_CPU)?L"(seconds, ":(get_multiplier(resource_arr[i].resource)==1?L"(":L"(kB, "));
const wchar_t *unit = ((resource_arr[i].resource==RLIMIT_CPU)?L"(seconds, ":(get_multiplier(resource_arr[i].resource)==1?L"(":L"(kB, "));
sb_printf( sb_out,
append_format(stdout_buffer,
L"%-*ls %10ls-%lc) ",
w,
resource_arr[i].desc,
@@ -178,10 +180,15 @@ static void print_all( int hard )
resource_arr[i].switch_char);
if( l == RLIM_INFINITY )
sb_append( sb_out, L"unlimited\n" );
{
stdout_buffer.append( L"unlimited\n" );
}
else
sb_printf( sb_out, L"%d\n", l );
{
append_format(stdout_buffer, L"%d\n", l/get_multiplier(resource_arr[i].resource) );
}
}
}
/**
@@ -202,14 +209,14 @@ static const wchar_t *get_desc( int what )
}
/**
Set the new value of the specified resource limit
Set the new value of the specified resource limit. This function
does _not_ multiply the limit value by the multiplier constant used
by the commandline ulimit.
*/
static int set( int resource, int hard, int soft, rlim_t value )
{
struct rlimit ls;
getrlimit( resource, &ls );
if( value != RLIM_INFINITY )
value *= get_multiplier( resource );
if( hard )
{
@@ -233,7 +240,7 @@ static int set( int resource, int hard, int soft, rlim_t value )
if( setrlimit( resource, &ls ) )
{
if( errno == EPERM )
sb_printf( sb_err, L"ulimit: Permission denied when changing resource of type '%ls'\n", get_desc( resource ) );
append_format(stderr_buffer, L"ulimit: Permission denied when changing resource of type '%ls'\n", get_desc( resource ) );
else
builtin_wperror( L"ulimit" );
return 1;
@@ -242,22 +249,10 @@ static int set( int resource, int hard, int soft, rlim_t value )
}
/**
Set all resource limits
The ulimit builtin, used for setting resource limits. Defined in
builtin_ulimit.c.
*/
static int set_all( int hard, int soft, rlim_t value )
{
int i;
int res=0;
for( i=0; resource_arr[i].desc; i++ )
{
if( set( resource_arr[i].resource, hard, soft, value ) )
res = 1;
}
return res;
}
int builtin_ulimit( wchar_t ** argv )
static int builtin_ulimit( parser_t &parser, wchar_t ** argv )
{
int hard=0;
int soft=0;
@@ -271,7 +266,7 @@ int builtin_ulimit( wchar_t ** argv )
while( 1 )
{
const static struct woption
static const struct woption
long_options[] =
{
{
@@ -311,7 +306,7 @@ int builtin_ulimit( wchar_t ** argv )
}
,
{
L"pipe-size", no_argument, 0, 'p'
L"stack-size", no_argument, 0, 's'
}
,
{
@@ -326,6 +321,10 @@ int builtin_ulimit( wchar_t ** argv )
L"virtual-memory-size", no_argument, 0, 'v'
}
,
{
L"help", no_argument, 0, 'h'
}
,
{
0, 0, 0, 0
}
@@ -337,7 +336,7 @@ int builtin_ulimit( wchar_t ** argv )
int opt = wgetopt_long( argc,
argv,
L"aHScdflmnptuv",
L"aHScdflmnstuvh",
long_options,
&opt_index );
if( opt == -1 )
@@ -348,11 +347,11 @@ int builtin_ulimit( wchar_t ** argv )
case 0:
if(long_options[opt_index].flag != 0)
break;
sb_printf( sb_err,
append_format(stderr_buffer,
BUILTIN_ERR_UNKNOWN,
argv[0],
long_options[opt_index].name );
builtin_print_help( argv[0], sb_err );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
@@ -379,13 +378,13 @@ int builtin_ulimit( wchar_t ** argv )
case L'f':
what=RLIMIT_FSIZE;
break;
#if HAVE_RLIMIT_MEMLOCK
#ifdef RLIMIT_MEMLOCK
case L'l':
what=RLIMIT_MEMLOCK;
break;
#endif
#if HAVE_RLIMIT_RSS
#ifdef RLIMIT_RSS
case L'm':
what=RLIMIT_RSS;
break;
@@ -403,41 +402,56 @@ int builtin_ulimit( wchar_t ** argv )
what=RLIMIT_CPU;
break;
#if HAVE_RLIMIT_NPROC
#ifdef RLIMIT_NPROC
case L'u':
what=RLIMIT_NPROC;
break;
#endif
#if HAVE_RLIMIT_AS
#ifdef RLIMIT_AS
case L'v':
what=RLIMIT_AS;
break;
#endif
case L'h':
builtin_print_help( parser, argv[0], stdout_buffer );
return 0;
case L'?':
builtin_print_help( argv[0], sb_err );
builtin_unknown_option( parser, argv[0], argv[woptind-1] );
return 1;
}
}
if( report_all )
{
if( argc - woptind == 0 )
{
print_all( hard );
}
else
{
stderr_buffer.append(argv[0]);
stderr_buffer.append(L": Too many arguments\n");
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
return 0;
}
switch( argc - woptind )
{
case 0:
{
/*
Show current limit value
*/
if( report_all )
{
print_all( hard );
}
else
{
print( what, hard );
}
print( what, hard );
break;
}
case 1:
{
/*
@@ -445,7 +459,7 @@ int builtin_ulimit( wchar_t ** argv )
*/
rlim_t new_limit;
wchar_t *end;
/*
Set both hard and soft limits if nothing else was specified
*/
@@ -454,7 +468,6 @@ int builtin_ulimit( wchar_t ** argv )
hard=soft=1;
}
if( wcscasecmp( argv[woptind], L"unlimited" )==0)
{
new_limit = RLIM_INFINITY;
@@ -473,37 +486,27 @@ int builtin_ulimit( wchar_t ** argv )
new_limit = wcstol( argv[woptind], &end, 10 );
if( errno || *end )
{
sb_printf( sb_err,
append_format(stderr_buffer,
L"%ls: Invalid limit '%ls'\n",
argv[0],
argv[woptind] );
builtin_print_help( argv[0], sb_err );
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
}
new_limit *= get_multiplier( what );
}
if( report_all )
{
return set_all( hard, soft, new_limit );
}
else
{
return set( what, hard, soft, new_limit );
}
break;
return set( what, hard, soft, new_limit );
}
default:
sb_append2( sb_err,
argv[0],
L": Too many arguments\n",
(void *)0 );
builtin_print_help( argv[0], sb_err );
{
stderr_buffer.append(argv[0]);
stderr_buffer.append(L": Too many arguments\n");
builtin_print_help( parser, argv[0], stderr_buffer );
return 1;
break;
}
}
return 0;
}

263
color.cpp Normal file
View File

@@ -0,0 +1,263 @@
/** \file color.cpp Color class implementation
*/
#include "color.h"
#include "fallback.h"
bool rgb_color_t::try_parse_special(const wcstring &special) {
bzero(&data, sizeof data);
const wchar_t *name = special.c_str();
if (! wcscasecmp(name, L"normal")) {
this->type = type_normal;
} else if (! wcscasecmp(name, L"reset")) {
this->type = type_reset;
} else if (! wcscasecmp(name, L"ignore")) {
this->type = type_ignore;
} else {
this->type = type_none;
}
return this->type != type_none;
}
static int parse_hex_digit(wchar_t x) {
switch (x) {
case L'0': return 0x0;
case L'1': return 0x1;
case L'2': return 0x2;
case L'3': return 0x3;
case L'4': return 0x4;
case L'5': return 0x5;
case L'6': return 0x6;
case L'7': return 0x7;
case L'8': return 0x8;
case L'9': return 0x9;
case L'a':case L'A': return 0xA;
case L'b':case L'B': return 0xB;
case L'c':case L'C': return 0xC;
case L'd':case L'D': return 0xD;
case L'e':case L'E': return 0xE;
case L'f':case L'F': return 0xF;
default: return -1;
}
}
static unsigned char convert_color(const unsigned char rgb[3], const uint32_t *colors, size_t color_count) {
long r = rgb[0], g = rgb[1], b = rgb[2];
unsigned long best_distance = (unsigned long)(-1);
unsigned char best_index = (unsigned char)(-1);
for (unsigned char idx = 0; idx < color_count; idx++) {
uint32_t color = colors[idx];
long test_r = (color >> 16) & 0xFF, test_g = (color >> 8) & 0xFF, test_b = (color >> 0) & 0xFF;
unsigned long distance = 0;
distance += (r - test_r) * (r - test_r);
distance += (g - test_g) * (g - test_g);
distance += (b - test_b) * (b - test_b);
if (distance <= best_distance) {
best_index = idx;
best_distance = distance;
}
}
return best_index;
}
bool rgb_color_t::try_parse_rgb(const wcstring &name) {
bzero(&data, sizeof data);
/* We support the following style of rgb formats (case insensitive):
#FA3
#F3A035
FA3
F3A035
*/
size_t digit_idx = 0, len = name.size();
/* Skip any leading # */
if (len > 0 && name.at(0) == L'#')
digit_idx++;
bool success = false;
size_t i;
if (len - digit_idx == 3) {
// type FA3
for (i=0; i < 3; i++) {
int val = parse_hex_digit(name.at(digit_idx++));
if (val < 0) break;
data.rgb[i] = val*16+val;
}
success = (i == 3);
} else if (len - digit_idx == 6) {
// type F3A035
for (i=0; i < 3; i++) {
int hi = parse_hex_digit(name.at(digit_idx++));
int lo = parse_hex_digit(name.at(digit_idx++));
if (lo < 0 || hi < 0) break;
data.rgb[i] = hi*16+lo;
}
success = (i == 3);
}
if (success) {
this->type = type_rgb;
}
return success;
}
struct named_color_t {
const wchar_t * name;
unsigned char idx;
unsigned char rgb[3];
};
static const named_color_t named_colors[11] = {
{L"black", 0, {0, 0, 0}},
{L"red", 1, {0xFF, 0, 0}},
{L"green", 2, {0, 0xFF, 0}},
{L"brown", 3, {0x72, 0x50, 0}},
{L"yellow", 3, {0xFF, 0xFF, 0}},
{L"blue", 4, {0, 0, 0xFF}},
{L"magenta", 5, {0xFF, 0, 0xFF}},
{L"purple", 5, {0xFF, 0, 0xFF}},
{L"cyan", 6, {0, 0xFF, 0xFF}},
{L"white", 7, {0xFF, 0xFF, 0xFF}},
{L"normal", 8, {0xFF, 0xFF, 0XFF}}
};
bool rgb_color_t::try_parse_named(const wcstring &str) {
bzero(&data, sizeof data);
size_t max = sizeof named_colors / sizeof *named_colors;
for (size_t idx=0; idx < max; idx++) {
if (0 == wcscasecmp(str.c_str(), named_colors[idx].name)) {
data.name_idx = named_colors[idx].idx;
this->type = type_named;
return true;
}
}
return false;
}
static const wchar_t *name_for_color_idx(unsigned char idx) {
size_t max = sizeof named_colors / sizeof *named_colors;
for (size_t i=0; i < max; i++) {
if (named_colors[i].idx == idx) {
return named_colors[i].name;
}
}
return L"unknown";
}
rgb_color_t::rgb_color_t(unsigned char t, unsigned char i) : type(t), flags(), data() {
data.name_idx = i;
}
rgb_color_t rgb_color_t::normal() { return rgb_color_t(type_normal); }
rgb_color_t rgb_color_t::reset() { return rgb_color_t(type_reset); }
rgb_color_t rgb_color_t::ignore() { return rgb_color_t(type_ignore); }
rgb_color_t rgb_color_t::none() { return rgb_color_t(type_none); }
rgb_color_t rgb_color_t::white() { return rgb_color_t(type_named, 7); }
rgb_color_t rgb_color_t::black() { return rgb_color_t(type_named, 0); }
static unsigned char term8_color_for_rgb(const unsigned char rgb[3]) {
const uint32_t kColors[] = {
0x000000, //Black
0xFF0000, //Red
0x00FF00, //Green
0x725000, //Brown
0xFFFF00, //Yellow
0x0000FF, //Blue
0xFF00FF, //Magenta
0xFF00FF, //Purple
0x00FFFF, //Cyan
0xFFFFFF, //White
};
return convert_color(rgb, kColors, sizeof kColors / sizeof *kColors);
}
static unsigned char term256_color_for_rgb(const unsigned char rgb[3]) {
const uint32_t kColors[240] = {
0x000000, 0x00005f, 0x000087, 0x0000af, 0x0000d7, 0x0000ff, 0x005f00, 0x005f5f,
0x005f87, 0x005faf, 0x005fd7, 0x005fff, 0x008700, 0x00875f, 0x008787, 0x0087af,
0x0087d7, 0x0087ff, 0x00af00, 0x00af5f, 0x00af87, 0x00afaf, 0x00afd7, 0x00afff,
0x00d700, 0x00d75f, 0x00d787, 0x00d7af, 0x00d7d7, 0x00d7ff, 0x00ff00, 0x00ff5f,
0x00ff87, 0x00ffaf, 0x00ffd7, 0x00ffff, 0x5f0000, 0x5f005f, 0x5f0087, 0x5f00af,
0x5f00d7, 0x5f00ff, 0x5f5f00, 0x5f5f5f, 0x5f5f87, 0x5f5faf, 0x5f5fd7, 0x5f5fff,
0x5f8700, 0x5f875f, 0x5f8787, 0x5f87af, 0x5f87d7, 0x5f87ff, 0x5faf00, 0x5faf5f,
0x5faf87, 0x5fafaf, 0x5fafd7, 0x5fafff, 0x5fd700, 0x5fd75f, 0x5fd787, 0x5fd7af,
0x5fd7d7, 0x5fd7ff, 0x5fff00, 0x5fff5f, 0x5fff87, 0x5fffaf, 0x5fffd7, 0x5fffff,
0x870000, 0x87005f, 0x870087, 0x8700af, 0x8700d7, 0x8700ff, 0x875f00, 0x875f5f,
0x875f87, 0x875faf, 0x875fd7, 0x875fff, 0x878700, 0x87875f, 0x878787, 0x8787af,
0x8787d7, 0x8787ff, 0x87af00, 0x87af5f, 0x87af87, 0x87afaf, 0x87afd7, 0x87afff,
0x87d700, 0x87d75f, 0x87d787, 0x87d7af, 0x87d7d7, 0x87d7ff, 0x87ff00, 0x87ff5f,
0x87ff87, 0x87ffaf, 0x87ffd7, 0x87ffff, 0xaf0000, 0xaf005f, 0xaf0087, 0xaf00af,
0xaf00d7, 0xaf00ff, 0xaf5f00, 0xaf5f5f, 0xaf5f87, 0xaf5faf, 0xaf5fd7, 0xaf5fff,
0xaf8700, 0xaf875f, 0xaf8787, 0xaf87af, 0xaf87d7, 0xaf87ff, 0xafaf00, 0xafaf5f,
0xafaf87, 0xafafaf, 0xafafd7, 0xafafff, 0xafd700, 0xafd75f, 0xafd787, 0xafd7af,
0xafd7d7, 0xafd7ff, 0xafff00, 0xafff5f, 0xafff87, 0xafffaf, 0xafffd7, 0xafffff,
0xd70000, 0xd7005f, 0xd70087, 0xd700af, 0xd700d7, 0xd700ff, 0xd75f00, 0xd75f5f,
0xd75f87, 0xd75faf, 0xd75fd7, 0xd75fff, 0xd78700, 0xd7875f, 0xd78787, 0xd787af,
0xd787d7, 0xd787ff, 0xd7af00, 0xd7af5f, 0xd7af87, 0xd7afaf, 0xd7afd7, 0xd7afff,
0xd7d700, 0xd7d75f, 0xd7d787, 0xd7d7af, 0xd7d7d7, 0xd7d7ff, 0xd7ff00, 0xd7ff5f,
0xd7ff87, 0xd7ffaf, 0xd7ffd7, 0xd7ffff, 0xff0000, 0xff005f, 0xff0087, 0xff00af,
0xff00d7, 0xff00ff, 0xff5f00, 0xff5f5f, 0xff5f87, 0xff5faf, 0xff5fd7, 0xff5fff,
0xff8700, 0xff875f, 0xff8787, 0xff87af, 0xff87d7, 0xff87ff, 0xffaf00, 0xffaf5f,
0xffaf87, 0xffafaf, 0xffafd7, 0xffafff, 0xffd700, 0xffd75f, 0xffd787, 0xffd7af,
0xffd7d7, 0xffd7ff, 0xffff00, 0xffff5f, 0xffff87, 0xffffaf, 0xffffd7, 0xffffff,
0x080808, 0x121212, 0x1c1c1c, 0x262626, 0x303030, 0x3a3a3a, 0x444444, 0x4e4e4e,
0x585858, 0x626262, 0x6c6c6c, 0x767676, 0x808080, 0x8a8a8a, 0x949494, 0x9e9e9e,
0xa8a8a8, 0xb2b2b2, 0xbcbcbc, 0xc6c6c6, 0xd0d0d0, 0xdadada, 0xe4e4e4, 0xeeeeee
};
return 16 + convert_color(rgb, kColors, sizeof kColors / sizeof *kColors);
}
unsigned char rgb_color_t::to_term256_index() const {
assert(type == type_rgb);
return term256_color_for_rgb(data.rgb);
}
unsigned char rgb_color_t::to_name_index() const {
if (type == type_named) {
return data.name_idx;
} else if (type == type_rgb) {
return term8_color_for_rgb(data.rgb);
} else {
throw "Bad type for to_name_index";
}
}
void rgb_color_t::parse(const wcstring &str) {
bool success = false;
if (! success) success = try_parse_special(str);
if (! success) success = try_parse_named(str);
if (! success) success = try_parse_rgb(str);
if (! success) {
bzero(this->data.rgb, sizeof this->data.rgb);
this->type = type_none;
}
}
rgb_color_t::rgb_color_t(const wcstring &str) {
this->parse(str);
}
rgb_color_t::rgb_color_t(const std::string &str) {
this->parse(str2wcstring(str));
}
wcstring rgb_color_t::description() const {
switch (type) {
case type_none:
return L"none";
case type_named:
return format_string(L"named(%d: %ls)", (int)data.name_idx, name_for_color_idx(data.name_idx));
case type_rgb:
return format_string(L"rgb(0x%02x%02x%02x)", data.rgb[0], data.rgb[1], data.rgb[2]);
case type_reset:
return L"reset";
case type_normal:
return L"normal";
case type_ignore:
return L"ignore";
default:
abort();
return L"";
}
}

133
color.h Normal file
View File

@@ -0,0 +1,133 @@
/** \file color.h Color class.
*/
#ifndef FISH_COLOR_H
#define FISH_COLOR_H
#include <stdint.h>
#include <cstddef>
#include "config.h"
#include "common.h"
/* A type that represents a color. We work hard to keep it at a size of 4 bytes. */
class rgb_color_t {
/* Types */
enum {
type_none,
type_named,
type_rgb,
type_normal,
type_reset,
type_ignore
};
unsigned char type:4;
/* Flags */
enum {
flag_bold = 1 << 0,
flag_underline = 1 << 1
};
unsigned char flags:4;
union {
unsigned char name_idx; //0-10
unsigned char rgb[3];
} data;
/** Try parsing a special color name like "normal" */
bool try_parse_special(const wcstring &str);
/** Try parsing an rgb color like "#F0A030" */
bool try_parse_rgb(const wcstring &str);
/** Try parsing an explicit color name like "magenta" */
bool try_parse_named(const wcstring &str);
/* Parsing entry point */
void parse(const wcstring &str);
/** Private constructor */
explicit rgb_color_t(unsigned char t, unsigned char i=0);
public:
/** Default constructor of type none */
explicit rgb_color_t() : type(type_none), flags(), data() {}
/** Parse a color from a string */
explicit rgb_color_t(const wcstring &str);
explicit rgb_color_t(const std::string &str);
/** Returns white */
static rgb_color_t white();
/** Returns black */
static rgb_color_t black();
/** Returns the reset special color */
static rgb_color_t reset();
/** Returns the normal special color */
static rgb_color_t normal();
/** Returns the ignore special color */
static rgb_color_t ignore();
/** Returns the none special color */
static rgb_color_t none();
/** Returns whether the color is the ignore special color */
bool is_ignore(void) const { return type == type_ignore; }
/** Returns whether the color is the normal special color */
bool is_normal(void) const { return type == type_normal; }
/** Returns whether the color is the reset special color */
bool is_reset(void) const { return type == type_reset; }
/** Returns whether the color is the none special color */
bool is_none(void) const { return type == type_none; }
/** Returns whether the color is a named color (like "magenta") */
bool is_named(void) const { return type == type_named; }
/** Returns whether the color is specified via RGB components */
bool is_rgb(void) const { return type == type_rgb; }
/** Returns whether the color is special, that is, not rgb or named */
bool is_special(void) const { return type != type_named && type != type_rgb; }
/** Returns a description of the color */
wcstring description() const;
/** Returns the name index for the given color. Requires that the color be named or RGB. */
unsigned char to_name_index() const;
/** Returns the term256 index for the given color. Requires that the color be named or RGB. */
unsigned char to_term256_index() const;
/** Returns whether the color is bold */
bool is_bold() const { return flags & flag_bold; }
/** Set whether the color is bold */
void set_bold(bool x) { if (x) flags |= flag_bold; else flags &= ~flag_bold; }
/** Returns whether the color is underlined */
bool is_underline() const { return !! (flags & flag_underline); }
/** Set whether the color is underlined */
void set_underline(bool x) { if (x) flags |= flag_underline; else flags &= ~flag_underline; }
/** Compare two colors for equality */
bool operator==(const rgb_color_t &other) const {
return type == other.type && ! memcmp(&data, &other.data, sizeof data);
}
/** Compare two colors for inequality */
bool operator!=(const rgb_color_t &other) const {
return !(*this == other);
}
};
#endif

1502
common.c

File diff suppressed because it is too large Load Diff

2021
common.cpp Normal file

File diff suppressed because it is too large Load Diff

626
common.h
View File

@@ -12,30 +12,74 @@
#include <stdio.h>
#include <wchar.h>
#include <termios.h>
#include <string>
#include <sstream>
#include <vector>
#include <pthread.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include "util.h"
class completion_t;
/* Common string type */
typedef std::wstring wcstring;
typedef std::vector<wcstring> wcstring_list_t;
/**
Maximum number of bytes used by a single utf-8 character
*/
#define MAX_UTF8_BYTES 6
/**
Color code for set_color. Does not update the color.
*/
#define FISH_COLOR_IGNORE -1
/**
Color code for set_color. Sets the default color.
*/
#define FISH_COLOR_RESET -2
/**
This is in the unicode private use area.
*/
#define ENCODE_DIRECT_BASE 0xf100
/**
Highest legal ascii value
*/
#define ASCII_MAX 127u
/**
Highest legal 16-bit unicode value
*/
#define UCS2_MAX 0xffffu
/**
Highest legal byte value
*/
#define BYTE_MAX 0xffu
/**
Escape special fish syntax characters like the semicolon
*/
#define UNESCAPE_SPECIAL 1
/**
Allow incomplete escape sequences
*/
#define UNESCAPE_INCOMPLETE 2
/**
Escape all characters, including magic characters like the semicolon
*/
#define ESCAPE_ALL 1
/**
Do not try to use 'simplified' quoted escapes, and do not use empty quotes as the empty string
*/
#define ESCAPE_NO_QUOTED 2
/**
Helper macro for errors
*/
#define VOMIT_ON_FAILURE(a) do { if (0 != (a)) { int err = errno; fprintf(stderr, "%s failed on line %d in file %s: %d (%s)\n", #a, __LINE__, __FILE__, err, strerror(err)); abort(); }} while (0)
/** Exits without invoking destructors (via _exit), useful for code after fork. */
void exit_without_destructors(int code) __attribute__ ((noreturn));
/**
Save the shell mode on startup so we can restore them on exit
*/
@@ -48,12 +92,8 @@ extern struct termios shell_modes;
extern wchar_t ellipsis_char;
/**
The maximum number of charset convertion errors to report
*/
extern int error_max;
/**
The verbosity of fish
The verbosity level of fish. If a call to debug has a severity
level higher than \c debug_level, it will not be printed.
*/
extern int debug_level;
@@ -66,16 +106,88 @@ extern char *profile;
Name of the current program. Should be set at startup. Used by the
debug function.
*/
extern wchar_t *program_name;
extern const wchar_t *program_name;
/**
Take an array_list_t containing wide strings and converts them to a
single null-terminated wchar_t **. The array is allocated using
halloc, and uses the \c context parameter as context. If \c context
is not noll, all elements of the \c array_list_t are also
registered to \c context using \c halloc_register().
This macro is used to check that an input argument is not null. It
is a bit lika a non-fatal form of assert. Instead of exit-ing on
failiure, the current function is ended at once. The second
parameter is the return value of the current function on failiure.
*/
wchar_t **list_to_char_arr( array_list_t *l );
#define CHECK( arg, retval ) \
if( !(arg) ) \
{ \
debug( 0, \
_( L"function %s called with null value for argument %s. " ), \
__func__, \
#arg ); \
bugreport(); \
show_stackframe(); \
return retval; \
}
/**
Pause for input, then exit the program. If supported, print a backtrace first.
*/
#define FATAL_EXIT() \
{ \
int exit_read_count;char exit_read_buff; \
show_stackframe(); \
exit_read_count=read( 0, &exit_read_buff, 1 ); \
exit_without_destructors( 1 ); \
} \
/**
Exit program at once, leaving an error message about running out of memory.
*/
#define DIE_MEM() \
{ \
fwprintf( stderr, \
L"fish: Out of memory on line %d of file %s, shutting down fish\n", \
__LINE__, \
__FILE__ ); \
FATAL_EXIT(); \
}
/**
Check if signals are blocked. If so, print an error message and
return from the function performing this check.
*/
#define CHECK_BLOCK( retval ) \
if( signal_is_blocked() ) \
{ \
debug( 0, \
_( L"function %s called while blocking signals. " ), \
__func__); \
bugreport(); \
show_stackframe(); \
return retval; \
}
/**
Shorthand for wgettext call
*/
#define _(wstr) wgettext((const wchar_t *)wstr)
/**
Noop, used to tell xgettext that a string should be translated,
even though it is not directly sent to wgettext.
*/
#define N_(wstr) wstr
/**
Check if the specified stringelement is a part of the specified string list
*/
#define contains( str,... ) contains_internal( str, __VA_ARGS__, NULL )
/**
Print a stack trace to stderr
*/
void show_stackframe();
wcstring_list_t completions_to_wcstring_list( const std::vector<completion_t> &completions );
/**
Read a line from the stream f into the buffer buff of length len. If
@@ -90,79 +202,350 @@ wchar_t **list_to_char_arr( array_list_t *l );
*/
int fgetws2( wchar_t **buff, int *len, FILE *f );
/**
Sorts a list of wide strings according to the wcsfilecmp-function
from the util library
*/
void sort_list( array_list_t *comp );
void sort_strings( std::vector<wcstring> &strings);
void sort_completions( std::vector<completion_t> &strings);
/**
Returns a newly allocated wide character string equivalent of the
specified multibyte character string
This function encodes illegal character sequences in a reversible
way using the private use area.
*/
wchar_t *str2wcs( const char *in );
/**
Returns a newly allocated wide character string equivalent of the
specified multibyte character string
This function encodes illegal character sequences in a reversible
way using the private use area.
*/
wcstring str2wcstring( const char *in );
wcstring str2wcstring( const std::string &in );
/**
Converts the narrow character string \c in into it's wide
equivalent, stored in \c out. \c out must have enough space to fit
the entire string.
This function encodes illegal character sequences in a reversible
way using the private use area.
*/
wchar_t *str2wcs_internal( const char *in, wchar_t *out );
/**
Returns a newly allocated multibyte character string equivalent of
the specified wide character string
This function decodes illegal character sequences in a reversible
way using the private use area.
*/
char *wcs2str( const wchar_t *in );
std::string wcs2string(const wcstring &input);
/** Test if a string prefixes another. Returns true if a is a prefix of b */
bool string_prefixes_string(const wcstring &proposed_prefix, const wcstring &value);
bool string_prefixes_string(const wchar_t *proposed_prefix, const wcstring &value);
/** Test if a string is a suffix of another */
bool string_suffixes_string(const wcstring &proposed_suffix, const wcstring &value);
bool string_suffixes_string(const wchar_t *proposed_suffix, const wcstring &value);
/** Test if a string prefixes another without regard to case. Returns true if a is a prefix of b */
bool string_prefixes_string_case_insensitive(const wcstring &proposed_prefix, const wcstring &value);
/** Test if a list contains a string using a linear search. */
bool list_contains_string(const wcstring_list_t &list, const wcstring &str);
void assert_is_main_thread(const char *who);
#define ASSERT_IS_MAIN_THREAD_TRAMPOLINE(x) assert_is_main_thread(x)
#define ASSERT_IS_MAIN_THREAD() ASSERT_IS_MAIN_THREAD_TRAMPOLINE(__FUNCTION__)
void assert_is_background_thread(const char *who);
#define ASSERT_IS_BACKGROUND_THREAD_TRAMPOLINE(x) assert_is_background_thread(x)
#define ASSERT_IS_BACKGROUND_THREAD() ASSERT_IS_BACKGROUND_THREAD_TRAMPOLINE(__FUNCTION__)
/* Useful macro for asserting that a lock is locked. This doesn't check whether this thread locked it, which it would be nice if it did, but here it is anyways. */
void assert_is_locked(void *mutex, const char *who, const char *caller);
#define ASSERT_IS_LOCKED(x) assert_is_locked((void *)(&x), #x, __FUNCTION__)
/**
Converts the wide character string \c in into it's narrow
equivalent, stored in \c out. \c out must have enough space to fit
the entire string.
This function decodes illegal character sequences in a reversible
way using the private use area.
*/
char *wcs2str_internal( const wchar_t *in, char *out );
/** Format the specified size (in bytes, kilobytes, etc.) into the specified stringbuffer. */
wcstring format_size(long long sz);
/** Version of format_size that does not allocate memory. */
void format_size_safe(char buff[128], unsigned long long sz);
/** Our crappier versions of debug which is guaranteed to not allocate any memory, or do anything other than call write(). This is useful after a call to fork() with threads. */
void debug_safe(int level, const char *msg, const char *param1 = NULL, const char *param2 = NULL, const char *param3 = NULL, const char *param4 = NULL, const char *param5 = NULL, const char *param6 = NULL, const char *param7 = NULL, const char *param8 = NULL, const char *param9 = NULL, const char *param10 = NULL, const char *param11 = NULL, const char *param12 = NULL);
/** Writes out a long safely */
void format_long_safe(char buff[128], long val);
void format_long_safe(wchar_t buff[128], long val);
template<typename T>
T from_string(const wcstring &x) {
T result;
std::wstringstream stream(x);
stream >> result;
return result;
}
template<typename T>
T from_string(const std::string &x) {
T result = T();
std::stringstream stream(x);
stream >> result;
return result;
}
template<typename T>
wcstring to_string(const T &x) {
std::wstringstream stream;
stream << x;
return stream.str();
}
/* wstringstream is a huge memory pig. Let's provide some specializations where we can. */
template<>
inline wcstring to_string(const long &x) {
wchar_t buff[128];
format_long_safe(buff, x);
return wcstring(buff);
}
template<>
inline bool from_string(const std::string &x) {
return ! x.empty() && strchr("YTyt1", x.at(0));
}
template<>
inline bool from_string(const wcstring &x) {
return ! x.empty() && wcschr(L"YTyt1", x.at(0));
}
template<>
inline wcstring to_string(const int &x) {
return to_string(static_cast<long>(x));
}
/* Helper class for managing a null-terminated array of null-terminated strings (of some char type) */
template <typename CharType_t>
class null_terminated_array_t {
CharType_t **array;
typedef std::basic_string<CharType_t> string_t;
typedef std::vector<string_t> string_list_t;
void swap(null_terminated_array_t<CharType_t> &him) { std::swap(array, him.array); }
/* Silly function to get the length of a null terminated array of...something */
template <typename T>
static size_t count_not_null(const T *arr) {
size_t len;
for (len=0; arr[len] != T(0); len++)
;
return len;
}
size_t size() const {
return count_not_null(array);
}
void free(void) {
if (array != NULL) {
for (size_t i = 0; array[i] != NULL; i++) {
delete [] array[i];
}
delete [] array;
array = NULL;
}
}
public:
null_terminated_array_t() : array(NULL) { }
null_terminated_array_t(const string_list_t &argv) : array(NULL) { this->set(argv); }
~null_terminated_array_t() { this->free(); }
/** operator=. Notice the pass-by-value parameter. */
null_terminated_array_t& operator=(null_terminated_array_t rhs) {
if (this != &rhs)
this->swap(rhs);
return *this;
}
/* Copy constructor. */
null_terminated_array_t(const null_terminated_array_t &him) : array(NULL) {
this->set(him.array);
}
void set(const string_list_t &argv) {
/* Get rid of the old argv */
this->free();
/* Allocate our null-terminated array of null-terminated strings */
size_t i, count = argv.size();
this->array = new CharType_t * [count + 1];
for (i=0; i < count; i++) {
const string_t &str = argv.at(i);
this->array[i] = new CharType_t [1 + str.size()];
std::copy(str.begin(), str.end(), this->array[i]);
this->array[i][str.size()] = CharType_t(0);
}
this->array[count] = NULL;
}
void set(const CharType_t * const *new_array) {
if (new_array == array)
return;
/* Get rid of the old argv */
this->free();
/* Copy the new one */
if (new_array) {
size_t i, count = count_not_null(new_array);
this->array = new CharType_t * [count + 1];
for (i=0; i < count; i++) {
size_t len = count_not_null(new_array[i]);
this->array[i] = new CharType_t [1 + len];
std::copy(new_array[i], new_array[i] + len, this->array[i]);
this->array[i][len] = CharType_t(0);
}
this->array[count] = NULL;
}
}
CharType_t **get() { return array; }
const CharType_t * const *get() const { return array; }
string_list_t to_list() const {
string_list_t lst;
if (array != NULL) {
size_t count = this->size();
lst.reserve(count);
lst.insert(lst.end(), array, array + count);
}
return lst;
}
};
/* Helper function to convert from a null_terminated_array_t<wchar_t> to a null_terminated_array_t<char_t> */
null_terminated_array_t<char> convert_wide_array_to_narrow(const null_terminated_array_t<wchar_t> &arr);
/* Helper class to cache a narrow version of a wcstring in a malloc'd buffer, so that we can read it after fork() */
class narrow_string_rep_t {
private:
const char *str;
public:
~narrow_string_rep_t() {
free((void *)str);
}
narrow_string_rep_t() : str(NULL) {}
void set(const wcstring &s) {
free((void *)str);
str = wcs2str(s.c_str());
}
const char *get() const {
return str;
}
};
bool is_forked_child();
/* Basic scoped lock class */
class scoped_lock {
pthread_mutex_t *lock_obj;
bool locked;
public:
void lock(void);
void unlock(void);
scoped_lock(pthread_mutex_t &mutex);
~scoped_lock();
};
class wcstokenizer {
wchar_t *buffer, *str, *state;
const wcstring sep;
public:
wcstokenizer(const wcstring &s, const wcstring &separator) : sep(separator) {
wchar_t *wcsdup(const wchar_t *s);
buffer = wcsdup(s.c_str());
str = buffer;
state = NULL;
}
bool next(wcstring &result) {
wchar_t *tmp = wcstok(str, sep.c_str(), &state);
str = NULL;
if (tmp) result = tmp;
return tmp != NULL;
}
~wcstokenizer() {
free(buffer);
}
};
/**
Appends a path component, with a / if necessary
*/
void append_path_component(wcstring &path, const wcstring &component);
wcstring format_string(const wchar_t *format, ...);
wcstring vformat_string(const wchar_t *format, va_list va_orig);
void append_format(wcstring &str, const wchar_t *format, ...);
/**
Returns a newly allocated wide character string array equivalent of
the specified multibyte character string array
*/
char **wcsv2strv( const wchar_t **in );
char **wcsv2strv( const wchar_t * const *in );
/**
Returns a newly allocated multibyte character string array equivalent of the specified wide character string array
*/
wchar_t **strv2wcsv( const char **in );
Test if the given string is a valid variable name.
/**
Returns a newly allocated concatenation of the specified wide
character strings
\return null if this is a valid name, and a pointer to the first invalid character otherwise
*/
wchar_t *wcsdupcat( const wchar_t *a, const wchar_t *b );
/**
Returns a newly allocated concatenation of the specified wide
character strings. The last argument must be a null pointer.
*/
wchar_t *wcsdupcat2( const wchar_t *a, ... );
wchar_t *wcsvarname( const wchar_t *str );
/**
Appends src to string dst of size siz (unlike wcsncat, siz is the
full size of dst, not space left). At most siz-1 characters will be
copied. Always NUL terminates (unless siz <= wcslen(dst)). Returns
wcslen(src) + MIN(siz, wcslen(initial dst)). If retval >= siz,
truncation occurred.
This is the OpenBSD strlcat function, modified for wide characters,
and renamed to reflect this change.
Test if the given string is a valid function name.
\return null if this is a valid name, and a pointer to the first invalid character otherwise
*/
size_t wcslcat( wchar_t *dst, const wchar_t *src, size_t siz );
const wchar_t *wcsfuncname( const wchar_t *str );
/**
Copy src to string dst of size siz. At most siz-1 characters will
be copied. Always NUL terminates (unless siz == 0). Returns
wcslen(src); if retval >= siz, truncation occurred.
Test if the given string is valid in a variable name
This is the OpenBSD strlcpy function, modified for wide characters,
and renamed to reflect this change.
*/
size_t wcslcpy( wchar_t *dst, const wchar_t *src, size_t siz );
/**
Test if the given string is a valid variable name
\return 1 if this is a valid name, 0 otherwise
*/
int wcsvarname( wchar_t *str );
int wcsvarchr( wchar_t chr );
/**
@@ -177,7 +560,7 @@ int my_wcswidth( const wchar_t *c );
\param in the position of the opening quote
*/
const wchar_t *quote_end( const wchar_t *in );
wchar_t *quote_end( const wchar_t *in );
/**
A call to this function will reset the error counter. Some
@@ -195,40 +578,46 @@ void error_reset();
the user is using a Unicode character set, and if so, use the
unicode ellipsis character as ellipsis, instead of '$'.
*/
const wchar_t *wsetlocale( int category, const wchar_t *locale );
wcstring wsetlocale( int category, const wchar_t *locale );
/**
Checks if \c needle is included in the list of strings specified
Checks if \c needle is included in the list of strings specified. A warning is printed if needle is zero.
\param needle the string to search for in the list
\return zero if needle is not found, of if needle is null, non-zero otherwise
*/
int contains_str( const wchar_t *needle, ... );
__sentinel bool contains_internal( const wchar_t *needle, ... );
__sentinel bool contains_internal( const wcstring &needle, ... );
/**
Call read while blocking the SIGCHLD signal. Should only be called
if you _know_ there is data available for reading.
if you _know_ there is data available for reading, or the program
will hang until there is data.
*/
int read_blocked(int fd, void *buf, size_t count);
/**
Exit program at once, leaving an error message about running out of memory
*/
void die_mem();
Loop a write request while failiure is non-critical. Return -1 and set errno
in case of critical error.
*/
ssize_t write_loop(int fd, const char *buff, size_t count);
/**
Create global_context using halloc
*/
void common_init();
Loop a read request while failiure is non-critical. Return -1 and set errno
in case of critical error.
*/
ssize_t read_loop(int fd, void *buff, size_t count);
/**
Free global_context using halloc_free
*/
void common_destroy();
/**
Issue a debug message with printf-style string formating and
automatic line breaking. The string will begin with the string \c
program_name, followed by a colon and a whitespace.
Because debug is often called to tell the user about an error,
before using wperror to give a specific error message, debug will
never ever modify the value of errno.
\param level the priority of the message. Lower number means higher priority. Messages with a priority_number higher than \c debug_level will be ignored..
\param msg the message format string.
@@ -251,6 +640,7 @@ void debug( int level, const wchar_t *msg, ... );
*/
wchar_t *escape( const wchar_t *in, int escape_all );
wcstring escape_string( const wcstring &in, int escape_all );
/**
Expand backslashed escapes and substitute them with their unescaped
@@ -266,29 +656,22 @@ wchar_t *escape( const wchar_t *in, int escape_all );
wchar_t *unescape( const wchar_t * in,
int escape_special );
/**
Attempt to acquire a lock based on a lockfile, waiting LOCKPOLLINTERVAL
milliseconds between polls and timing out after timeout seconds,
thereafter forcibly attempting to obtain the lock if force is non-zero.
Returns 1 on success, 0 on failure.
To release the lock the lockfile must be unlinked.
A unique temporary file named by appending characters to the lockfile name
is used; any pre-existing file of the same name is subject to deletion.
*/
int acquire_lock_file( const char *lockfile, const int timeout, int force );
bool unescape_string( wcstring &str,
int escape_special );
/**
Returns the width of the terminal window, so that not all
functions that use these values continually have to keep track of
it.
Returns the width of the terminal window, so that not all
functions that use these values continually have to keep track of
it separately.
Only works if common_handle_winch is registered to handle winch signals.
Only works if common_handle_winch is registered to handle winch signals.
*/
int common_get_width();
/**
Returns the height of the terminal window, so that not all
functions that use these values continually have to keep track of
it.
it separatly.
Only works if common_handle_winch is registered to handle winch signals.
*/
@@ -302,11 +685,62 @@ int common_get_height();
void common_handle_winch( int signal );
/**
Write paragraph of output to screen. Ignore newlines in message and
perform internal line-breaking.
Write paragraph of output to the specified stringbuffer, and redo
the linebreaks to fit the current screen.
*/
void write_screen( const wchar_t *msg );
void write_screen( const wcstring &msg, wcstring &buff );
/**
Tokenize the specified string into the specified wcstring_list_t.
\param val the input string. The contents of this string is not changed.
\param out the list in which to place the elements.
*/
void tokenize_variable_array( const wcstring &val, wcstring_list_t &out);
/**
Make sure the specified direcotry exists. If needed, try to create
it and any currently not existing parent directories..
\return 0 if, at the time of function return the directory exists, -1 otherwise.
*/
int create_directory( const wcstring &d );
/**
Print a short message about how to file a bug report to stderr
*/
void bugreport();
/**
Return the number of seconds from the UNIX epoch, with subsecond
precision. This function uses the gettimeofday function, and will
have the same precision as that function.
If an error occurs, NAN is returned.
*/
double timef();
/**
Call the following function early in main to set the main thread.
This is our replacement for pthread_main_np().
*/
void set_main_thread();
bool is_main_thread();
/** Configures thread assertions for testing */
void configure_thread_assertions_for_testing();
/** Set up a guard to complain if we try to do certain things (like take a lock) after calling fork */
void setup_fork_guards(void);
/** Return whether we are the child of a fork */
bool is_forked_child(void);
void assert_is_not_forked_child(const char *who);
#define ASSERT_IS_NOT_FORKED_CHILD_TRAMPOLINE(x) assert_is_not_forked_child(x)
#define ASSERT_IS_NOT_FORKED_CHILD() ASSERT_IS_NOT_FORKED_CHILD_TRAMPOLINE(__FUNCTION__)
extern "C" {
__attribute__((noinline)) void debug_thread_error(void);
}
#endif

2137
complete.c

File diff suppressed because it is too large Load Diff

2004
complete.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +1,166 @@
/** \file complete.h
Prototypes for functions related to tab-completion.
These functions are used for storing and retrieving tab-completion data, as well as for performing tab-completion.
These functions are used for storing and retrieving tab-completion
data, as well as for performing tab-completion.
*/
#ifndef FISH_COMPLETE_H
/**
Header guard
*/
#define FISH_COMPLETE_H
#include <wchar.h>
#include "util.h"
/** Use all completions */
#include "common.h"
/**
Use all completions
*/
#define SHARED 0
/** Do not use file completion */
/**
Do not use file completion
*/
#define NO_FILES 1
/** Require a parameter after completion */
/**
Require a parameter after completion
*/
#define NO_COMMON 2
/** Only use the argument list specifies with completion after option. This is the same as (NO_FILES & NO_COMMON) */
/**
Only use the argument list specifies with completion after
option. This is the same as (NO_FILES & NO_COMMON)
*/
#define EXCLUSIVE 3
/** Command is a path */
/**
Command is a path
*/
#define PATH 1
/** Command is not a path */
/**
Command is not a path
*/
#define COMMAND 0
/** Separateor between completion and description*/
/**
Separator between completion and description
*/
#define COMPLETE_SEP L'\004'
/** Separateor between completion and description*/
/**
Separator between completion and description
*/
#define COMPLETE_SEP_STR L"\004"
/**
Separator between completion items in fish_pager. This is used for
completion grouping, e.g. when putting completions with the same
descriptions on the same line.
*/
#define COMPLETE_ITEM_SEP L'\uf500'
/**
Character that separates the completion and description on programmable completions
Character that separates the completion and description on
programmable completions
*/
#define PROG_COMPLETE_SEP L'\t'
/**
Initializes various structures used for tab-completion.
*/
void complete_init();
enum {
/**
Do not insert space afterwards if this is the only completion. (The
default is to try insert a space)
*/
COMPLETE_NO_SPACE = 1 << 0,
/**
Destroys various structures used for tab-completion and free()s the memory used by them.
*/
void complete_destroy();
/**
This compeltion is case insensitive.
Warning: The contents of the completion_t structure is actually
different if this flag is set! Specifically, the completion string
contains the _entire_ completion token, not only the current
*/
COMPLETE_NO_CASE = 1 << 1,
/**
This compeltion is the whole argument, not just the remainder. This
flag must never be set on completions returned from the complete()
function. It is strictly for internal use in the completion code.
*/
COMPLETE_WHOLE_ARGUMENT = 1 << 2,
/**
This completion may or may not want a space at the end - guess by
checking the last character of the completion.
*/
COMPLETE_AUTO_SPACE = 1 << 3,
/**
This completion should be inserted as-is, without escaping.
*/
COMPLETE_DONT_ESCAPE = 1 << 4
};
typedef int complete_flags_t;
class completion_t
{
private:
/* No public default constructor */
completion_t(){ }
public:
/**
The completion string
*/
wcstring completion;
/**
The description for this completion
*/
wcstring description;
/**
Flags determining the completion behaviour.
Determines whether a space should be inserted after this
compeltion if it is the only possible completion using the
COMPLETE_NO_SPACE flag.
The COMPLETE_NO_CASE can be used to signal that this completion
is case insensitive.
*/
int flags;
completion_t(const wcstring &comp, const wcstring &desc = L"", int flags_val = 0) : completion(comp), description(desc), flags(flags_val) {
if( flags & COMPLETE_AUTO_SPACE )
{
flags = flags & ~COMPLETE_AUTO_SPACE;
size_t len = completion.size();
if (len > 0 && ( wcschr( L"/=@:", comp.at(len-1)) != 0 ))
flags |= COMPLETE_NO_SPACE;
}
}
bool operator < (const completion_t& rhs) const { return this->completion < rhs.completion; }
bool operator == (const completion_t& rhs) const { return this->completion == rhs.completion; }
bool operator != (const completion_t& rhs) const { return ! (*this == rhs); }
};
enum complete_type_t {
COMPLETE_DEFAULT,
COMPLETE_AUTOSUGGEST
};
/**
Add a completion.
Values are copied and should be freed by the caller.
All supplied values are copied, they should be freed by or otherwise
disposed by the caller.
Examples:
@@ -88,63 +194,52 @@ void complete_destroy();
file completion is not performed.
\param comp A space separated list of completions which may contain subshells.
\param desc A description of the completion.
\param authorative Whether there list of completions for this command is complete. If true, any options not matching one of the provided options will be flagged as an error by syntax highlighting.
\param condition a command to be run to check it this completion should be used. If \c condition is empty, the completion is always used.
\param flags A set of completion flags
*/
void complete_add( const wchar_t *cmd,
int cmd_type,
wchar_t short_opt,
const wchar_t *long_opt,
int long_mode,
int result_mode,
int authorative,
const wchar_t *condition,
const wchar_t *comp,
const wchar_t *desc );
bool cmd_is_path,
wchar_t short_opt,
const wchar_t *long_opt,
int long_mode,
int result_mode,
const wchar_t *condition,
const wchar_t *comp,
const wchar_t *desc,
int flags );
/**
Sets whether the completion list for this command is complete. If
true, any options not matching one of the provided options will be
flagged as an error by syntax highlighting.
*/
void complete_set_authoritative( const wchar_t *cmd, bool cmd_type, bool authoritative );
/**
Remove a previously defined completion
*/
void complete_remove( const wchar_t *cmd,
int cmd_type,
wchar_t short_opt,
const wchar_t *long_opt );
bool cmd_is_path,
wchar_t short_opt,
const wchar_t *long_opt );
/** Find all completions of the command cmd, insert them into out. If to_load is not NULL, append all commands that we would autoload, but did not (presumably because this is not the main thread) */
void complete( const wcstring &cmd, std::vector<completion_t> &comp, complete_type_t type, wcstring_list_t *to_load = NULL );
/**
Find all completions of the command cmd, insert them into out. The
caller must free the variables returned in out. The results are
returned in the array_list_t 'out', in the format of wide character
strings, with each element consisting of a suggested completion and
a description of what kind of object this completion represents,
separated by a separator of type COMPLETE_SEP.
Print a list of all current completions into the string.
Values returned by this function should be freed by the caller.
\param out The string to write completions to
*/
void complete( const wchar_t *cmd, array_list_t *out );
/**
Print a list of all current completions into the string_buffer_t.
\param out The string_buffer_t to write completions to
*/
void complete_print( string_buffer_t *out );
/**
Obtain a description string for the file specified by the filename.
The returned value is a string constant and should not be freed.
\param filename The file for which to find a description string
*/
const wchar_t *complete_get_desc( const wchar_t *filename );
void complete_print( wcstring &out );
/**
Tests if the specified option is defined for the specified command
*/
int complete_is_valid_option( const wchar_t *str,
const wchar_t *opt,
array_list_t *errors );
wcstring_list_t *inErrorsOrNull,
bool allow_autoload );
/**
Tests if the specified argument is valid for the specified option
@@ -164,6 +259,18 @@ int complete_is_valid_argument( const wchar_t *str,
\param cmd the command for which to load command-specific completions
\param reload should the commands completions be reloaded, even if they where previously loaded. (This is set to true on actual completions, so that changed completion are updated in running shells)
*/
void complete_load( const wchar_t *cmd, int reload );
void complete_load( const wcstring &cmd, bool reload );
/**
Create a new completion entry
\param completions The array of completions to append to
\param comp The completion string
\param desc The description of the completion
\param flags completion flags
*/
void completion_allocate(std::vector<completion_t> &completions, const wcstring &comp, const wcstring &desc, int flags);
#endif

File diff suppressed because it is too large Load Diff

22
count.c
View File

@@ -1,22 +0,0 @@
/** \file count.c
The length command, used for determining the number of items in an
environment variable array.
*/
#include <stdlib.h>
#include <stdio.h>
/**
The main function. Does nothing but return the number of arguments.
This command, unlike all other fish commands, does not feature a -h
or --help option. This is because we want to avoid errors on arrays
that have -h or --help as entries, which is very common when
parsing options, etc. For this reason, the main fish binary does a
check and prints help usage if -h or --help is explicitly given to
the command, but not if it is the contents of a variable.
*/
int main( int argc, char **argv )
{
printf( "%d\n", argc-1 );
return argc==1;
}

121
create_wajig_completions.py Executable file
View File

@@ -0,0 +1,121 @@
#!/usr/bin/env python
# -*- python -*-
# Program to generate fish completion function for wajig.
# It runs 'wajig command' and analyzes the output to build a
# completion file which it writes to stdout.
# To use the result, direct stdout to
# ~/.fish.d/completions/wajig.fish.
# Author Reuben Thomas, from Don Rozenberg's bash_completion.py and
# fish's apt-get.fish.
import os
import re
import pprint
pp = pprint.PrettyPrinter()
def escape_quotes(s):
return re.sub('\'', '\\\'', s)
# Run wajig command
f = os.popen('wajig commands', 'r')
lines = f.readlines()
option_patt = r'^-([a-z]*)\|--([a-z]*) +([^ ].*)'
option_patt_r = re.compile(option_patt)
command_patt = r'^([a-z-]*) +([^ ].*)'
command_patt_r = re.compile(command_patt)
os_str = []
os_str.append('')
ol_str = []
ol_str.append('')
oh_str = []
oh_str.append('')
o_i = 0
c_str = []
c_str.append('')
ch_str = []
ch_str.append('')
c_i = 0
for l in lines:
l = l.strip()
if l == '' or l.find(':') > -1 or l.find('Run') == 0:
continue
if l.find('-') == 0:
mo = option_patt_r.search(l)
if mo == None:
continue
os_str[o_i] = mo.group(1)
os_str.append('')
ol_str[o_i] = mo.group(2)
ol_str.append('')
oh_str[o_i] = escape_quotes(mo.group(3))
oh_str.append('')
o_i += 1
else:
mo = command_patt_r.search(l)
if mo == None:
continue
c_str[c_i] = mo.group(1)
c_str.append('')
ch_str[c_i] = escape_quotes(mo.group(2))
ch_str.append('')
c_i += 1
# For debugging, print the commands and options.
#print
#pp.pprint(c_str)
#print
#pp.pprint(os_str)
#print
#pp.pprint(ol_str)
part1 = '''function __fish_wajig_no_subcommand -d (N_ 'Test if wajig has yet to be given the subcommand')
for i in (commandline -opc)
if contains -- $i'''
part2 = '''
return 1
end
end
return 0
end
function __fish_wajig_use_package -d (N_ 'Test if wajig command should have packages as potential completion')
for i in (commandline -opc)
if contains -- $i contains bug build build-depend changelog dependents describe detail hold install installr installrs installs list list-files news package purge purge-depend readme recursive recommended reconfigure reinstall remove remove-depend repackage show showinstall showremove showupgrade size sizes source suggested unhold upgrade versions whatis
return 0
end
end
return 1
end
complete -c wajig -n '__fish_wajig_use_package' -a '(__fish_print_packages)' -d (N_ 'Package')'''
wajig = part1
#add the commands.
for i in range(0, len(c_str) - 1):
wajig = "%s %s" % (wajig, c_str[i])
#add part2
wajig = "%s%s" % (wajig, part2)
#add the options.
wajig = "%s%s" % (wajig, os_str[0].lstrip())
for i in range(1, len(os_str) - 1):
wajig = "%s\ncomplete -c apt-get -s %s -l %s -d (N_ '%s')" % (wajig, os_str[i], ol_str[i], oh_str[i])
#add the commands.
for i in range(0, len(c_str) - 1):
wajig = "%s\ncomplete -f -n '__fish_wajig_no_subcommand' -c wajig -a '%s' -d(N_ '%s')" % (wajig, c_str[i], ch_str[i])
#print it all
print wajig

18
doc_src/alias.txt Normal file
View File

@@ -0,0 +1,18 @@
\section alias alias - create a function
\subsection alias-synopsis Synopsis
<pre>alias NAME DEFINITION
alias NAME=DEFINITION</pre>
\subsection alias-description Description
Alias is a shellscript wrapper around the function builtin.
It exists for backwards compatibility with Posix
shells. For other uses, it is recommended to define a <a
href='#function'>function</a>.
Alias does not keep track of which functions have been defined using
alias, nor does it allow erasing of aliases.
- NAME is the name of the function to define
- DEFINITION is the body of the function. The string " $argv" will be appended to the body.

View File

@@ -1,17 +1,27 @@
\section and and - Conditionally execute a command
\section and and - conditionally execute a command
\subsection and-synopsis Synopsis
<tt>COMMAND1; and COMMAND2</tt>
<tt>COMMAND1; and COMMAND2</tt>
\subsection and-description Description
The \c and builtin is used to execute a command if the current exit status (as set by the last previous command) is zero
The \c and builtin is used to execute a command if the current exit
status (as set by the last previous command) is 0.
The and command does not change the current exit status.
The exit status of the last foreground command to exit can always be
accessed using the <a href="index.html#variables-status">$status</a>
variable.
\subsection and-example Example
The following code runs the \c make command to build a program, and if it succeeds, it runs <tt>make install</tt>, which installs the program.
The following code runs the \c make command to build a program, if the
build succeeds, the program is installed. If either step fails,
<tt>make clean</tt> is run, which removes the files created by the
build process
<pre>
make; and make install
make; and make install; or make clean
</pre>

View File

@@ -1,17 +1,19 @@
\section begin begin - Start a new block of code
\section begin begin - start a new block of code
\subsection begin-synopsis Synopsis
<tt>begin; [COMMAND;...] end </tt>
<tt>begin; [COMMANDS...;] end</tt>
\subsection begin-description Description
The \c begin builtin is used to create a new block of code. The block
is unconditionally executed. Begin is equivalent to <tt>if
true</tt>. The begin command is used to group any number of commands
into a block. The reason for this is usually either to introduce a new
variable scope or to redirect the input to output of this set of
commands as a group.
is unconditionally executed. <code>begin; ...; end</tt> is equivalent
to <tt>if true; ...; end</tt>. The begin command is used to group any
number of commands into a block. The reason for doing so is usually
either to introduce a new variable scope, to redirect the input or
output of a set of commands as a group, or to specify precedence when
using the conditional commands like \c and.
The \c begin command does not change the current exit status.
\subsection begin-example Example
@@ -21,10 +23,24 @@ scope, they will be automatically deleted when the block ends.
<pre>
begin
set -x PIRATE Yarrr
set -l PIRATE Yarrr
...
end
# This will not output anything, since PIRATE went out of scope at the end of
# the block and was killed
# This will not output anything, since the PIRATE variable went out
# of scope at the end of the block
echo $PIRATE
</pre>
In the following code, all output is redirected to the file out.html.
<pre>
begin
echo $xml_header
echo $html_header
if test -e $file
...
end
...
end &gt; out.html
</pre>

View File

@@ -8,7 +8,7 @@ Sends the specified jobs to the background. A background job is
executed simultaneously with fish, and does not have access to the
keyboard. If no job is specified, the last job to be used is put in the background. If PID is specified, the jobs with the specified group ids are put in the background.
The PID of the desired process is usually found by using process globbing.
The PID of the desired process is usually found by using <a href="index.html#expand-process">process expansion</a>.
\subsection bg-example Example

View File

@@ -1,16 +1,60 @@
\section bind bind - Handle key bindings.
\section bind bind - handle fish key bindings
\subsection bind-synopsis Synopsis
<tt>bind [OPTIONS] [BINDINGS...] </tt>
The <tt>bind</tt> builtin causes fish to add the readline style bindings specified by <tt>BINDINGS</tt> to the list of key bindings. For more information on specifying keyboard bindings, use <tt>man readline</tt> to access the readline documentation.
<tt>bind [OPTIONS] SEQUENCE COMMAND</tt>
\subsection bind-description Description
- <tt>-M MODE</tt> or <tt>--set-mode=MODE</tt> sets the current input mode to MODE.
The <tt>bind</tt> builtin causes fish to add a key binding from the specified sequence.
SEQUENCE is the character sequence to bind to. Usually, one would use
fish escape sequences to express them. For example, because pressing
the Alt key and another character sends that character prefixed with
an escape character, Alt-based key bindings can be written using the
\c \\e escape. For example, Alt-w can be written as
<tt>\\ew</tt>. Control character can be written in much the same way
using the \c \\c escape, for example Control-x can be written as
<tt>\\cx</tt>. Note that Alt-based key bindings are case sensitive and
Control base key bindings are not. This is not a design choice in
fish, it is simply how terminals work.
If SEQUENCE is the empty string, i.e. an empty set of quotes, this is
interpreted as the default keybinding. It will be used whenever no
other binding matches. For most key bindings, it makes sense to use
the \c self-insert function (i.e. <tt>bind '' self-insert</tt> as the
default keybining. This will insert any keystrokes not specifically
bound to into the editor. Non-printable characters are ignored by the
editor, so this will not result in e.g. control sequences being
printable.
If the -k switch is used, the name of the key (such as down, up or
backspace) is used instead of a sequence. The names used are the same
as the corresponding curses variables, but without the 'key_'
prefix. (See man 5 terminfo for more information, or use <tt>bind
--key-names</tt> for a list of all available named keys)
COMMAND can be any fish command, but it can also be one of a set of
special input functions. These include functions for moving the
cursor, operating on the kill-ring, performing tab completion,
etc. Use 'bind --function-names' for a complete list of these input
functions.
When COMMAND is a shellscript command, it is a good practice to put
the actual code into a <a href="#function">function</a> and simply
bind to the function name. This way it becomes significantly easier to
test the function while editing, and the result is usually more
readable as well.
- <tt>-a</tt> or <tt>--all</tt> If --key-names is specified, show all key names, not only the ones that actually are defined for the current terminal. If erase mode is specified, this switch will cause all current bindings to be erased.
- <tt>-e</tt> or <tt>--erase</tt> Erase mode. All non-switch arguments are interpreted as character sequences and any commands associated with those sequences are erased.
- <tt>-h</tt> or <tt>--help</tt> Display help and exit
- <tt>-k</tt> or <tt>--key</tt> Specify a key name, such as 'left' or 'backspace' instead of a character sequence
- <tt>-K</tt> or <tt>--key-names</tt> Display a list of available key names
- <tt>-f</tt> or <tt>--function-names</tt> Display a list of available input functions
\subsection bind-example Example
<tt>bind -M vi</tt> changes to the vi input mode
<tt>bind \\cd 'exit'</tt> causes fish to exit on Control-d
<tt>bind -k ppage history-search-backward</tt> Causes fish to perform a history search when the page up key is pressed
<tt>bind '"\\M-j": jobs'</tt> Binds the jobs command to the Alt-j keyboard shortcut

View File

@@ -1,5 +1,4 @@
\section block block - Temporarily block delivery of events
\section block block - temporarily block delivery of events
\subsection block-synopsis Synopsis
<tt>block [OPTIONS...]</tt>
@@ -12,7 +11,8 @@
\subsection block-example Example
<pre>block -g
<pre>
block -g
\#Do something that should not be interrupted
block -e
</pre>

View File

@@ -1,4 +1,3 @@
\section break break - stop the innermost currently evaluated loop
\subsection break-synopsis Synopsis
@@ -9,13 +8,12 @@ The \c break builtin is used to halt a currently running loop, such as a <a href
\subsection break-example Example
The following code searches all .c files for smurfs, and halts at the first occurrence.
<p>
<tt>for i in *.c;
<br>&nbsp;&nbsp;&nbsp;&nbsp;if grep smurf $i;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo Smurfs are present in $i;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
<br>&nbsp;&nbsp;&nbsp;&nbsp;end;
<br>end;
</tt>
</p>
<pre>
for i in *.c
if grep smurf $i
echo Smurfs are present in $i
break
end
end
</pre>

10
doc_src/breakpoint.txt Normal file
View File

@@ -0,0 +1,10 @@
\section breakpoint breakpoint - Launch debug mode
\subsection breakpoint-synopsis Synopsis
<tt>breakpoint</tt>
\subsection breakpoint-description Description
The \c breakpoint builtin is used to halt a running script and launch
an interactive debug prompt.

View File

@@ -1,4 +1,3 @@
\section builtin builtin - run a builtin command
\subsection builtin-synopsis Synopsis
@@ -8,7 +7,7 @@
- <tt>-n</tt> or <tt>--names</tt> List the names of all defined builtins
Prefixing a command with the word 'builtin' forces fish to ignore any aliases with the same name.
Prefixing a command with the word 'builtin' forces fish to ignore any functions with the same name.
\subsection builtin-example Example

View File

@@ -1,7 +1,7 @@
\section case case - conditionally execute a block of commands
\subsection case-synopsis Synopsis
<tt>switch VALUE; [case [WILDCARD...]; [COMMANDS...];...] end</tt>
<tt>switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end</tt>
\subsection case-description Description
@@ -11,12 +11,27 @@ wildcarded values. The \c case statement is used together with the \c
switch statement in order to determine which block should be
performed.
Each \c case command is given one or more parameter. The first \c case
command with a parameter that matches the string specified in the
switch command will be evaluated. \c case parameters may contain
wildcards. These need to be escaped or quoted in order to avoid
regular wildcard expansion using filenames.
Note that fish does not fall through on case statements. Though the
syntax may look a bit like C switch statements, it behaves more like
the case statements of traditional shells.
Also note that command substitutions in a case statement will be
evaluated even if it's body is not taken. This may seem
counterintuitive at first, but it is unavoidable, since it would be
impossible to know if a case command will evaluate to true before all
forms of parameter expansion have been performed for the case command.
\subsection case-example Example
If the variable \$animal contains the name of an animal, the following
code would attempt to classify it:
<p>
<pre>
switch $animal
case cat
@@ -27,9 +42,11 @@ switch $animal
echo bird
case shark trout stingray
echo fish
case '*'
echo I have no idea what a $animal is
end
</pre>
</p>
<p>
If the above code was run with \$animal set to \c whale, the output would be \c mammal.
</p>
If the above code was run with \c \$animal set to \c whale, the output
would be \c mammal.

View File

@@ -4,11 +4,11 @@
<tt>command COMMANDNAME [OPTIONS...]</tt>
\subsection command-description Description
prefixing a command with the word 'command' forces fish to ignore any aliases or builtins with the same name.
prefixing a command with the word 'command' forces fish to ignore any functions or builtins with the same name.
\subsection command-example Example
<tt>command ls</tt>
causes fish to execute the ls program, even if there exists a 'ls' alias.
causes fish to execute the ls program, even if there exists a 'ls' function.

View File

@@ -1,4 +1,4 @@
\section commandline commandline - Set or get the current commandline buffer
\section commandline commandline - set or get the current commandline buffer
\subsection commandline-synopsis Synopsis
<tt>commandline [OPTIONS] [CMD]</tt>
@@ -7,10 +7,26 @@
- \c CMD is the new value of the commandline. If unspecified, the
current value of the commandline is written to standard output.
current value of the commandline is written to standard output. All
output from the commandline builtin is escaped, i.e. quotes are
removed, backslash escapes are expanded, etc..
The following switches change what the commandline builtin does
- \c -C or \c --cursor set or get the current cursor position, not
the contents of the buffer. If no argument is given, the current
cursor position is printed, otherwise the argument is interpreted
as the new cursor position.
- \c -f or \c --function inject readline functions into the
reader. This option can not be combined with any other option. It
will cause any additional arguments to be interpreted as readline
functions, and these functions will be injected into the reader, so
that they will be returned to the reader before any additional
actual key presses are read.
The following switches change the way \c commandline updates the
commandline
commandline buffer
- \c -a or \c --append do not remove the current commandline, append
the specified string at the end of it
@@ -25,23 +41,15 @@ or updated
- \c -b or \c --current-buffer select the entire buffer (default)
- \c -j or \c --current-job select the current job
- \c -p or \c --current-process select the current process
- \c -t or \c --current_token select the current token.
- \c -t or \c --current-token select the current token.
The following switch changes the way \c commandline prints the current
commandline
commandline buffer
- \c -c or \c --cut-at-cursor only print selection up until the
current cursor position
- \c -o or \c --tokenize tokenize the selection and print one string-type token per line
Other switches
- \c -f or \c --function inject readline functions into the
reader. This option can not be combined with any other option. It
will cause any additional arguments to be interpreted as readline
functions, and these functions will be injected into the reader, so
that they will be returned to the reader before any additional
actual keypresses are read.
If commandline is called during a call to complete a given string
using <code>complete -C STRING</code>, commandline will consider the

6
doc_src/commands.hdr.in Normal file
View File

@@ -0,0 +1,6 @@
/** \page commands Commands, functions and builtins bundled with fish
Fish ships with a large number of builtin commands, shellscript functions and external commands. These are all described below.
@command_list@
*/

View File

@@ -6,7 +6,7 @@
\subsection complete-description Description
For an introduction to how to specify completions, see the section <a
href='index.html#completions-own'>Writing your own completions</a> of
href='index.html#completion-own'>Writing your own completions</a> of
the fish manual.
- <tt>COMMAND</tt> is the name of the command for which to add a completion
@@ -21,7 +21,8 @@ the fish manual.
- <tt>-o</tt> or <tt>--old-option</tt> implies that the command uses old long style options with only one dash
- <tt>-p</tt> or <tt>--path</tt> implies that the string COMMAND is the full path of the command
- <tt>-r</tt> or <tt>--require-parameter</tt> specifies that the option specified by this completion always must have an option argument, i.e. may not be followed by another option
- <tt>-u</tt> or <tt>--unauthorative</tt> implies that there may be more options than the ones specified, and that fish should not assume that options not listed are spelling errors
- <tt>-u</tt> or <tt>--unauthoritative</tt> implies that there may be more options than the ones specified, and that fish should not assume that options not listed are spelling errors
- <tt>-A</tt> or <tt>--authoritative</tt> implies that there may be no more options than the ones specified, and that fish should assume that options not listed are spelling errors
- <tt>-x</tt> or <tt>--exclusive</tt> implies both <tt>-r</tt> and <tt>-f</tt>
Command specific tab-completions in \c fish are based on the notion

View File

@@ -1,5 +1,4 @@
\section contains contains - Test if a word is present in a list
\section contains contains - test if a word is present in a list
\subsection contains-synopsis Synopsis
<code>contains [OPTIONS] KEY [VALUES...]</code>

View File

@@ -1,20 +1,19 @@
\section continue continue - skip the rest of the current lap of the innermost currently evaluated loop
\subsection continue-synopsis Synopsis
<tt>LOOP_CONSTRUCT; [COMMANDS...] continue; [COMMANDS...] end</tt>
<tt>LOOP_CONSTRUCT; [COMMANDS...;] continue; [COMMANDS...;] end</tt>
\subsection continue-description Description
The \c continue builtin is used to skip the current lap of the innermost currently running loop, such as a <a href="#for">for</a> loop or a <a href="#while">while</a> loop. It is usually added inside of a conditional block such as an <a href="#if">if</a> statement or a <a href="#switch">switch</a> statement.
\subsection continue-example Example
The following code removes all tmp files without smurfs.
<p>
<tt>for i in *.tmp;
<br>&nbsp;&nbsp;&nbsp;&nbsp;if grep smurf $i;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;continue;
<br>&nbsp;&nbsp;&nbsp;&nbsp;end;
<br>&nbsp;&nbsp;&nbsp;&nbsp;rm $i;
<br>end;
</tt>
</p>
<pre>
for i in *.tmp
if grep smurf $i
continue
end
rm $i
end
</pre>

View File

@@ -1,22 +1,25 @@
\section count count - Count the number of elements of an array
\section count count - count the number of elements of an array
\subsection count-synopsis Synopsis
<tt>count $VARIABLE</tt>
\subsection count-description Description
<tt>count</tt> returns the number of arguments that were passed to
it. This is usually used to find out how many elements an environment
variable array contains, but this is not the only potential usage for
the count command.
The <tt>count</tt> builtin prints the number of arguments that were
passed to it. This is usually used to find out how many elements an
environment variable array contains, but this is not the only
potential usage for the count command.
The count command does not accept any options, not even '-h'. This way
the user does not have to worry about an array containing elements
such as dashes. \c fish performs a special check when invoking the
count program, and if the user uses a help option, this help page is
count command, and if the user uses a help option, this help page is
displayed, but if a help option is contained inside of a variable or
is the result of expansion, it will be passed on to the count program.
is the result of expansion, it will simply be counted like any other
argument.
Count exits with a non-zero exit status if no arguments where passed
to it, with zero otherwise.
\subsection count-example Example

155
doc_src/design.hdr Normal file
View File

@@ -0,0 +1,155 @@
/** \page design Design document
\section design-overview Overview
This is a description of the design principles that have been used to
design fish. The fish design has three high level goals. These are:
-# Everything that can be done in other shell languages should be
possible to do in fish, though fish may rely on external commands in
doing so.
-# Fish should be user friendly, but not at the expense of expressiveness.
Most tradeoffs between power and ease of use can be avoided with careful design.
-# Whenever possible without breaking the above goals, fish should
follow the Posix syntax.
To achive these high-level goals, the fish design relies on a number
of more specific design principles. These are presented below,
together with a rationale and a few examples for each.
\section ortho The law of orthogonality
The shell language should have a small set of orthogonal features. Any
situation where two features are related but not identical, one of them
should be removed, and the other should be made powerful and general
enough to handle all common use cases of either feature.
Rationale:
Related features make the language larger, which makes it harder to
learn. It also increases the size of the sourcecode, making the
program harder to maintain and update.
Examples:
- Here documents are too similar to using echo inside of a pipeline.
- Subshells, command substitution and process substitution are strongly related. \c fish only supports command substitution, the others can be achived either using a block or the psub shellscript function.
- Having both aliases and functions is confusing, especially since both of them have limitations and problems. \c fish functions have none of the drawbacks of either syntax.
- The many Posix quoting styles are silly, especially \$''.
\section sep The law of minimalism
The shell should only contain features that cannot be implemented in
a reasonable way outside of the shell. A large performance decrease,
as well as some program complexity increase is acceptable in order to
improve separation.
Rationale:
A modular project is easier to maintain since smaller programs are far
easier to understand than larger ones. A modular project is also more
future proof since the modules can be individually
replaced. Modularity also decreases the severity of bugs, since there
is good hope that a bug, even a serious one, in one module, does not
take the whole system down.
Examples:
- Builtin commands should only be created when it cannot be
avoided. \c echo, \c kill, \c printf and \c time are among the commands
that fish does not implement internally since they can be provided as
external commands. Several other commands that are commonly implemented
as builtins and can not be implemented as external commands,
including \c type, \c vared, \c pushd and \c popd are implemented as shellscript
functions in fish.
- Mathematical calculations, regex matching, generating lists of numbers
and many other funtions can easily be done in external programs. They
should not be supported internally by the shell.
The law of minimalism does not imply that a large feature set is
bad. So long as a feature is not part of the shell itself, but a
separate command or at least a shellscript function, bloat is fine.
\section conf Configurability is the root of all evil
Every configuration option in a program is a place where the program
is too stupid to figure out for itself what the user really wants, and
should be considered a failiure of both the program and the programmer
who implemented it.
Rationale:
Different configuration options are a nightmare to maintain, since the
number of potential bugs caused by specific configuration combinations
quickly becomes an issue. Configuration options often imply
assumptions about the code which change when reimplementing the code,
causing issues with backwards compatibility. But mostly, configuration
options should be avoided since they simply should not exist, as the
program should be smart enough to do what is best, or at least a good
enough approximation of it.
Examples:
- Fish allows the user to set various syntax highlighting colors. This is needed because fish does not know what colors the terminal uses by default, which might make some things unreadable. The proper solution would be for text color preferences to be defined centrally by the user for all programs, and for the terminal emulator to send these color properties to fish.
- Fish does not allow you to set the history filename, the number of history entries, different language substyles or any number of other common shell configuration options.
A special note on the evils of configurability is the long list of
very useful features found in some shells, that are not turned on by
default. Both zsh and bash support command specific completions, but
no such completions are shipped with bash by default, and they are
turned of by default in zsh. Other features that zsh support that are
disabled by default include tab-completion of strings containing
wildcards, a sane completion pager and a history file.
\section user The law of user focus
When designing a program, one should first think about how to make a
intuitive and powerful program. Implementation issues should only be
considered once a user interface has been designed.
Rationale:
This design rule is different than the others, since it describes how
one should go about designing new features, not what the features
should be. The problem with focusing on what can be done, and what is
easy to do, is that to much of the implementation is exposed. This
means that the user must know a great deal about the underlying system
to be able to guess how the shell works, it also means that the
language will often be rather low-level.
Examples:
- There should only be one type of input to the shell, lists of commands. Loops, conditionals and variable assignments are all performed through regular commands.
- The differences between builtin commands, shellscript functions and builtin commands should be made as small as possible. Builtins and shellscript functions should have exactly the same types of argument expansion as other commands, should be possible to use in any position in a pipeline, and should support any io redirection.
- Instead of forking when performing command substitution to provide a fake variable scope, all fish commands are performed from the same process, and fish instead supports true scoping.
- All blocks end with the \c end builtin.
\section disc The law of discoverability
A program should be designed to make its features as
easy as possible to discover for the user.
Rationale:
A program whose features are discoverable turns a new user into an
expert in a shorter span of time, since the user will become an expert
on the program simply by using it.
The main benefit of a graphical program over a command line-based
program is discoverability. In a graphical program, one can discover
all the common features by simply looking at the user interface and
guessing what the different buttons, menus and other widgets do. The
traditional way to discover features in commandline programs is
through manual pages. This requires both that the user starts to use a
different program, and the she/he then remembers the new information
until the next time she/he uses the same program.
Examples:
- Everything should be tab-completable, and every tab completion should have a description.
- Every syntax error and error in a builtin command should contain an error message describing what went wrong and a relevant help page. Whenever possible, errors should be flagged red by the syntax highlighter.
- The help manual should be easy to read, easily available from the shell, complete and contain many examples
- The language should be uniform, so that once the user understands the command/argument syntax, he will know the whole language, and be able to use tab-completion to discover new featues.
*/

View File

@@ -1,8 +1,8 @@
\section dirh dirh
\section dirh dirh - print directory history
\subsection dirh-synopsis Synopsis
<tt>dirh</tt>
\subsection dirh-description Description
\subsection dirh-description Description
<tt>dirh</tt> prints the current directory history. The current position in the
history is highlighted using <tt>$fish_color_history_current</tt>.

View File

@@ -1,7 +1,7 @@
\section dirs dirs
\section dirs dirs - print directory stack
\subsection dirs-synopsis Synopsis
<tt>dirs</tt>
\subsection dirs-description Description
\subsection dirs-description Description
<tt>dirs</tt> prints the current directory stack.

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,17 @@
\section else else - execute command if a condition is not met.
\section else else - execute command if a condition is not met
\subsection else-synopsis Synopsis
<tt>if CONDITION; COMMAND_TRUE [else; COMMAND_FALSE] end;</tt>
<tt>if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end</tt>
\subsection else-description Description
<tt>if</tt> will execute the command CONDITION. If the commands exit
status is zero, the command COMMAND_TRUE will execute. If it is
not zero and COMMAND_FALSE is specified, COMMAND_FALSE will be
executed.
<tt>if</tt> will execute the command CONDITION. If the condition's exit
status is 0, the commands COMMANDS_TRUE will execute. If it is not 0 and
<tt>else</tt> is given, COMMANDS_FALSE will be executed. Hint: use
<a href="#begin"><tt>begin; ...; end</tt></a> for complex conditions.
\subsection else-example Example
The command <tt>if test -f foo.txt; echo foo.txt exists; else; echo foo.txt does not exist; end</tt>
will print <tt>foo.txt exists</tt> if the file foo.txt
exists and is a regular file, otherwise it will print
exists and is a regular file, otherwise it will print
<tt>foo.txt does not exist</tt>.

19
doc_src/emit.txt Normal file
View File

@@ -0,0 +1,19 @@
\section emit emit - Emit a generic event
\subsection block-synopsis Synopsis
<tt>emit EVENT_NAME</tt>
\subsection emit-description Description
The emit builtin fires a generic fish event. Such events can be caught by special functions called event handlers.
\subsection emit-example Example
The following code first defines an event handler for the generic
event named 'test_event', and then emits an event of that type.
<pre>function event_test --on-event test_event
echo event test!!!
end
emit test_event</pre>

View File

@@ -1,13 +1,17 @@
\section end end - end a block of commands.
\subsection end-synopsis Synopsis
<pre>for VARNAME in [VALUES...]; COMMANDS; end
if CONDITION; COMMAND_TRUE [else; COMMAND_FALSE] end
while CONDITION; COMMANDS; end
switch VALUE; [case [WILDCARD...]; [COMMANDS...];...] end
<pre>
begin; [COMMANDS...] end
if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end
while CONDITION; COMMANDS...; end
for VARNAME in [VALUES...]; COMMANDS...; end
switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end
</pre>
\subsection end-description Description
<tt>end</tt> ends a block of commands. For more information, read the
documentation for the block constructs, such as \c if, \c for and \
documentation for the block constructs, such as \c if, \c for and \c
while.
The \c end command does not change the current exit status.

View File

@@ -1,10 +1,10 @@
\section eval eval - eval the specified commands
\section eval eval - evaluate the specified commands
\subsection eval-synopsis Synopsis
<tt>eval [COMMANDS...]</tt>
\subsection eval-description Description
The <tt>eval</tt> builtin causes fish to evaluate the specified parameters as a command. If more than one parameter is specified, all parameters will be joined using a space character as a separator.
The <tt>eval</tt> function causes fish to evaluate the specified parameters as a command. If more than one parameter is specified, all parameters will be joined using a space character as a separator.
\subsection eval-example Example

View File

@@ -1,5 +1,4 @@
\section exec exec - Execute command in current process
\section exec exec - execute command in current process
\subsection exec-synopsis Synopsis
<tt>exec COMMAND [OPTIONS...]</tt>

View File

@@ -7,8 +7,8 @@
The <tt>exit</tt> builtin causes fish to exit. If <tt>STATUS</tt> is
supplied, it will be converted to an integer and used as the exit
code. Otherwise the exit code will be 0.
code. Otherwise the exit code will be that of the last command executed.
If exit is called while sourcing a file (using the <a
href="#source">.</a> builtin) the rest of the file will be skipped,
but the shell will not exit.
but the shell itself will not exit.

161
doc_src/faq.hdr Normal file
View File

@@ -0,0 +1,161 @@
/** \page faq Frequently asked questions
- <a href='#faq-cwd-symlink'>Why does cd, pwd and other fish commands always resolve symlinked directories to their canonical path?</a>
- <a href='#faq-cd-autocomplete'>Why does the cd command autocompletion list the subdirectories of my home directory as completions?</a>
- <a href='#faq-cd-implicit'>I accidentally entered a directory path and fish changed directory. What happened?</a>
- <a href='#faq-open'>The open command doesn't work.</a>
- <a href='#faq-default'>How do I make fish my default shell?</a>
- <a href='#faq-titlebar'>I'm seeing weird output before each prompt when using screen. What's wrong?</a>
- <a href='#faq-greeting'>How do I change the greeting message?</a>
- <a href='#faq-history'>Why doesn't history substitution ("!$" etc.) work?</a>
<hr>
\section faq-cwd-symlink Why does cd, $PWD and and various fish commands always resolve symlinked directories to their canonical path?
<i>
For example if ~/images is a symlink to ~/Documents/Images, if I write
'cd images', my prompt will say ~/D/Images, not ~/images.
</i>
Because it is impossible to consistently keep symlinked directories
unresolved. It is indeed possible to do this partially, and many other
shells do so. But it was felt there are enough serious corner cases
that this is a bad idea. Most such issues have to do with how '..' is
handled, and are varitations of the following example:
Writing <code>cd images; ls ..</code> given the above directory
structure would list the contents of ~/Documents, not of ~, even
though using <code>cd ..</code> changes the current direcotry to ~,
and the prompt, the pwd builtin and many other directory information
sources suggest that the the current directory is ~/images and it's
parent is ~. This issue is not possible to fix without either making
every single command into a builtin, breaking Unix semantics or
implementing kludges in every single command.
This issue can also be seen when doing IO redirection.
Another related issue is that many programs that operate on recursive
directory trees, like the find command, silently ignore symlinked
directories. For example, <code>find $PWD -name '*.txt'</code>
silently fails in shells that don't resolve symlinked paths.
<hr>
\section faq-cd-autocomplete Why does the cd command autocompletion list the subdirectories of my home directory as completions?
Because they are completions. In fish, if you specify a relative
directory to the cd command, i.e. any path that does not start with
either './' or '/', the environment variable CDPATH will be examined, and any
directories in this path is used as a base direcotry. To disable this
feature, write <code>set CDPATH .</code> on the commandline.
<hr>
\section faq-cd-implicit I accidentally entered a directory path and fish changed directory. What happened?
If fish is unable to locate a command with a given name, fish will
test if a directory of that name exists. If it does, it is implicitly
assumed that you want to change working directory. For example, the
fastest way to switch to your home directory is to simply press
<code>~</code> and enter.
<hr>
\section faq-open The open command doesn't work.
The open command uses the mimetype database and the .desktop files
used by Gnome and KDE to identify filetypes and default actions. If
at least one of these two desktops are installed, but the open command is
not working, this probably means that the relevant files are installed
in a nonstandard location. Please contact the <a
href='mailto:fish-users@lists.sf.net'>fish mailing list</a>, and
hopefully this can be resolved.
<hr>
\section faq-default How do I make fish my default shell?
If you installed fish manually (e.g. by compiling it, not by using a
package manager), you first need to add fish to the list of shells by
executing the following command (assuming you installed fish in
/usr/local) as root:
<code>echo /usr/local/bin/fish >>/etc/shells</code>
If you installed a prepackaged version of fish, the package manager
should have already done this for you.
In order to change your default shell, type:
<code>chsh -s /usr/local/bin/fish</code>
You may need to adjust the above path to e.g. /usr/bin/fish. Use the command <code>which fish</code> if you are unsure of where fish is installed.
Unfortunatly, there is no way to make the changes take effect at once,
you will need to log out and back in again.
<hr>
\section faq-titlebar I'm seeing weird output before each prompt when using screen. What's wrong?
Quick answer:
Run the following command in fish:
<pre>
echo 'function fish_title;end' &gt; ~/.config/fish/config.fish
</pre>
Problem solved!
The long answer:
Fish is trying to set the titlebar message of your terminal. While
screen itself supports this feature, your terminal does
not. Unfortuntaly, when the underlying terminal doesn't support
setting the titlebar, screen simply passes through the escape codes
and text to the underlying terminal instead of ignoring them. It is
impossible detect and resolve this problem from inside fish since fish
has no way of knowing what the underlying terminal type is. For now,
the only way to fix this is to unset the titlebar message, as
suggested above.
Note that fish has a default titlebar message, which will be used if
the fish_title function is undefined. So simply unsetting the
fish_title function will not work.
<hr>
\section faq-greeting How do I change the greeting message?
Change the value of the variable fish_greeting. For example, to remove
the greeting use:
<pre>
set fish_greeting
</pre>
<hr>
\section faq-history Why doesn't history substitution ("!$" etc.) work?
Because history substitution is an awkward interface that was invented before
interactive line editing was even possible. Fish drops it in favor of
perfecting the interactive history recall interface. Switching requires a
small change of habits: if you want to modify an old line/word, first recall
it, then edit. E.g. don't type "sudo !!" - first press Up, then Home, then
type "sudo ".
Fish history recall is very simple yet effective:
- As in any modern shell, the Up arrow recalls whole lines, starting from the last line executed. A single press replaces "!!", later presses replace "!-3" and the like.
- If the line you want is far back in the history, type any part of the line and then press Up one or more times. This will constrain the recall to lines that include this text, and you will get to the line you want much faster. This replaces "!vi", "!?bar.c" and the like.
- Alt+Up recalls individual arguments, starting from the last argument in the last line executed. A single press replaces "!$", later presses replace "!!:4" and the like.
- If the argument you want is far back in history (e.g. 2 lines back - that's a lot of words!), type any part of it and then press Alt+Up. This will show only arguments containing that part and you will get what you want much faster. Try it out, this is very convenient!
- If you want to reuse several arguments from the same line ("!!:3*" and the like), consider recalling the whole line and removing what you don't need (Alt+D and Alt+Backspace are your friends).
See <a href='index.html#editor'>documentation</a> for more details about line editing in fish.
*/

View File

@@ -7,7 +7,7 @@
Sends the specified job to the foreground. While a foreground job is
executed, fish is suspended. If no job is specified, the last job to be used is put in the foreground. If PID is specified, the job with the specified group id is put in the foreground.
The PID of the desired process is usually found by using process globbing.
The PID of the desired process is usually found by using <a href="index.html#expand-process">process expansion</a>.
\subsection fg-example Example

View File

@@ -1,27 +0,0 @@
.TH fish 1 "February 25, 2005" "version @PACKAGE_VERSION@" "USER COMMANDS"
.SH NAME
fish - friendly interactive shell
.SH SYNOPSIS
.B fish
[\-h] [\-v] [\-c command] [FILE [ARGUMENTS...]]
.SH DESCRIPTION
A shell written mainly with interactive use in mind. The complete fish manuals are written in HTML format. You can find them by using the
.I
help
command from inside the fish shell.
.SH OPTIONS
.TP
\-h
display help and exit
.TP
\-c
Evaluate the specified commands instead of reading from the commandline
.TP
\-i
Specify that fish is to run in interactive mode
.TP
\-v
display version and exit
.SH AUTHOR
Axel Liljencrantz ( @PACKAGE_BUGREPORT@ )

23
doc_src/fish.txt Normal file
View File

@@ -0,0 +1,23 @@
\section fish fish - the friendly interactive shell
\subsection fish-synopsis Synopsis
fish [-h] [-v] [-c command] [FILE [ARGUMENTS...]]
\subsection fish-description Description
A commandline shell written mainly with interactive use in mind. The
full manual is available <a href='index.html'>in html</a> by using the
<a href='#help'>help</a> command from inside fish.
- <code>-c</code> or <code>--command=COMMANDS</code> evaluate the specified commands instead of reading from the commandline
- <code>-d</code> or <code>--debug-level=DEBUG_LEVEL</code> specify the verbosity level of fish. A higher number means higher verbosity. The default level is 1.
- <code>-h</code> or <code>--help</code> display help and exit
- <code>-i</code> or <code>--interactive</code> specify that fish is to run in interactive mode
- <code>-l</code> or <code>--login</code> specify that fish is to run as a login shell
- <code>-n</code> or <code>--no-execute</code> do not execute any commands, only perform syntax checking
- <code>-p</code> or <code>--profile=PROFILE_FILE</code> when fish exits, output timing information on all executed commands to the specified file
- <code>-v</code> or <code>--version</code> display version and exit
The fish exit status is generally the exit status of the last
foreground command. If fish is exiting because of a parse error, the
exit status is 127.

5
doc_src/fish_config.txt Normal file
View File

@@ -0,0 +1,5 @@
\section fish_config fish_config - Start up the web-based configuration interface
\subsection fish_config-description Description
This command starts up the web-based configuration interface, which allows you to edit your colors and view your functions, variables, and history.

17
doc_src/fish_indent.txt Normal file
View File

@@ -0,0 +1,17 @@
\section fish_indent fish_indent - indenter and prettifier
\subsection fish_indent-synopsis Synopsis
<tt>fish_indent [options]</tt>
\subsection fish_indent-description Description
\c fish_indent is used to indent or otherwise prettify a piece of fish
code. \c fish_indent reads commands from standard input and outputs
them to standard output.
\c fish_indent understands the following options:
- <tt>-h</tt> or <tt>--help</tt> displays this help message and then exits
- <tt>-i</tt> or <tt>--no-indent</tt> do not indent commands
- <tt>-v</tt> or <tt>--version</tt> displays the current fish version and then exits

View File

@@ -1,5 +1,4 @@
\section fish_pager fish_pager - Internal command used by fish
\section fish_pager fish_pager - internal command used by fish
\subsection fish_pager-description Description

23
doc_src/fish_prompt.txt Normal file
View File

@@ -0,0 +1,23 @@
\section fish_prompt fish_prompt - define the apperance of the command line prompt
\subsection fish_promt-synopsis Synopsis
<pre>function fish_prompt
...
end</pre>
\subsection fish_prompt-description Description
By defining the \c fish_prompt function, the user can choose a custom
prompt. The \c fish_prompt function is executed when the prompt is to
be shown, and the output is used as a prompt.
\subsection fish_prompt-example Example
A simple prompt:
<pre>
function fish_prompt -d "Write out the prompt"
printf '\%s\@\%s\%s\%s\%s> ' (whoami) (hostname|cut -d . -f 1) (set_color \$fish_color_cwd) (prompt_pwd) (set_color normal)
end
</pre>

View File

@@ -0,0 +1,6 @@
\section fish_update_completions fish_update_completions - Update man-page completions
\subsection fish_update_completions-description Description
This command parses your installed man pages and writes completion files to the fish config directory. This does not overwrite custom completions.

View File

@@ -1,5 +1,4 @@
\section fishd fishd - Universal variable daemon
\section fishd fishd - universal variable daemon
\subsection fishd-synopsis Synopsis
<tt>fishd [(-h|--help|-v|--version)]</tt>
@@ -18,8 +17,15 @@ When no clients are connected, fishd will automatically shut down.
\subsection fishd-files Files
~/.fishd.HOSTNAME permanent storage location for universal variable
data. The data is stored as a set of \c set and \c set_export commands
such as would be parsed by fishd. If an instance of fishd is running
(which is generally the case), manual modifications to ~/.fishd.HOSTNAME
will be lost.
\c ~/.config/fish/fishd.HOSTNAME permanent storage location for universal
variable data. The data is stored as a set of \c set and \c set_export
commands such as would be parsed by fishd. The file must always be
stored in ASCII format. If an instance of fishd is running (which is
generally the case), manual modifications to ~/.fishd.HOSTNAME will be
lost. Do NOT edit this file manually!
\c /tmp/fishd.socket.USERNAME the socket which fishd uses to communicate
with all clients.
/tmp/fishd.log.USERNAME the fishd log file

View File

@@ -1,23 +1,25 @@
\section for for - perform a set of commands multiple times.
\subsection for-synopsis Synopsis
<tt>for VARNAME in [VALUES...]; [COMMANDS...]; end</tt>
<tt>for VARNAME in [VALUES...]; COMMANDS...; end</tt>
\subsection for-description Description
<tt>for</tt> is a loop construct. It will perform the commands specified
by <tt>COMMANDS</tt> multiple times. Each time the environment variable
specified by <tt>VARNAME</tt> is assigned a new value from <tt>VALUES</tt>.
<tt>for</tt> is a loop construct. It will perform the commands specified by
COMMANDS multiple times. Each time the environment variable specified by
VARNAME is assigned a new value from VALUES. If VALUES is empty, COMMANDS will
not be executed at all.
\subsection for-example Example
The command
The command
<tt>for i in foo bar baz; echo $i; end</tt>
would output:
<pre>foo
<pre>
foo
bar
baz</pre>
baz
</pre>

9
doc_src/funced.txt Normal file
View File

@@ -0,0 +1,9 @@
\section funced funced - edit a function interactively
\subsection funced-synopsis Synopsis
<code>funced NAME</code>
\subsection funced-description Description
Use the funced command to interactively edit the definition of a
function. If there is no function with the name specified, a skeleton function is inserted, if a function exist, the definion will be shown on the command line.

12
doc_src/funcsave.txt Normal file
View File

@@ -0,0 +1,12 @@
\section funcsave funcsave - save the definition of a function to the users autoload directory
\subsection funcsave-synopsis Synopsis
<tt>funcsave FUNCTION_NAME</tt>
\subsection funcsave-description Description
funcsave is used to save the current definition of a function to
a file which will be autoloaded by current and future fish
sessions. This can be useful if you have interactively created a new
function and wish to save it for later use.

View File

@@ -1,18 +1,18 @@
\section function function - create a function
\subsection function-synopsis Synopsis
<tt>function [OPTIONS] NAME; BODY; end </tt>
<code>function [OPTIONS] NAME; BODY; end </code>
\subsection function-description Description
- \c -b or \c --key-binding specifies that the function is a key biding. Key binding functions work exactly like regular functions except that they can not be tab-completed, and may contain the '-' character.
- <tt>-d DESCRIPTION</tt> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion description
- <tt>-j PID</tt> or <tt> --on-job-exit PID</tt> tells fish to run this function when the job with group id PID exits
- <tt>-p PID</tt> or <tt> --on-process-exit PID</tt> tells fish to run this function when the fish child process with process id PID exits
- <tt>-s</tt> or <tt>--on-signal SIGSPEC</tt> tells fish to run this function when the signal SIGSPEC is delivered. SIGSPEC can be a signal number, or the signal name, such as SIGHUP (or just HUP)
- <tt>-v</tt> or <tt>--on-variable VARIABLE_NAME</tt> tells fish to run this function when the variable VARIABLE_NAME changes value
- <code>-d DESCRIPTION</code> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion description
- <code>-e</code> or <code>--on-event EVENT_NAME</code> tells fish to run this function when the specified named event is emitted. Fish internally generates named events e.g. when showing the prompt.
- <code>-j PID</code> or <code> --on-job-exit PID</code> tells fish to run this function when the job with group id PID exits. Instead of PID, the string 'caller' can be specified. This is only legal when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
- <code>-p PID</code> or <code> --on-process-exit PID</code> tells fish to run this function when the fish child process with process id PID exits
- <code>-s</code> or <code>--on-signal SIGSPEC</code> tells fish to run this function when the signal SIGSPEC is delivered. SIGSPEC can be a signal number, or the signal name, such as SIGHUP (or just HUP)
- <code>-v</code> or <code>--on-variable VARIABLE_NAME</code> tells fish to run this function when the variable VARIABLE_NAME changes value
This builtin command is used to create a new function. A Function is a
This builtin command is used to create a new function. A function is a
list of commands that will be executed when the name of the function
is entered. The function
@@ -22,14 +22,20 @@ function hi
end
</pre>
will write <tt>hello</tt> whenever the user enters \c hi.
will write <code>hello</code> whenever the user enters \c hi.
If the user enters any additional arguments after the function, they
are inserted into the environment variable <a href="index.html#variables-arrays">array</a> argv.
are inserted into the environment <a href="index.html#variables-arrays">variable array</a> argv.
By using one of the event handler switches, a function can be made to run automatically at specific events. The user may generate new events using the <a href='#emit">emit</a> builtin. Fish generates the following named events:
- \c fish_prompt, which is emitted whenever a new fish prompt is about to be displayed
- \c fish_command_not_found, which is emitted whenever a command lookup failed
\subsection function-example Example
<pre>function ll
<pre>
function ll
ls -l $argv
end
</pre>

View File

@@ -1,17 +1,31 @@
\section functions functions - print or erase functions
\subsection function-synopsis Synopsis
<tt>functions [-e] FUNCTIONS...</tt>
<code>functions [-e] FUNCTIONS...</code>
\subsection functions-description Description
This builtin command is used to print or erase functions.
- <tt>-e</tt> or <tt>--erase</tt> causes the specified functions to be erased.
- <tt>-n</tt> or <tt>--names</tt> List only the names of all defined functions
- <code>-a</code> or <code>--all</code> list all functions, even those whose name start with an underscore.
- <code>-c OLDNAME NEWNAME</code> or <code>--copy OLDNAME NEWNAME</code> creates a new function named NEWNAME, using the definition of the OLDNAME function.
- <code>-d DESCRIPTION</code> or <code>--description=DESCRIPTION</code> change the description of this function
- <code>-e</code> or <code>--erase</code> causes the specified functions to be erased.
- <code>-h</code> or <code>--help</code> display a help message and exit
- <code>-n</code> or <code>--names</code> list only the names of all defined functions, not their definition
- <code>-q</code> or <code>--query</code> test if the specified functions exist. Does not output anything, but the builtins exit status is the number of functions specified that were not defined.
If \c functions is called with no arguments, the names and definition
of all functions are printed, otherwise, the specified function
definitions will be printed.
The default behavior of \c functions when called with no arguments,
is to print the names and definitions of all defined functions. If any
non-switch parameters are given, only the definition of the specified
functions are printed.
Automatically loaded functions can not be removed using functions
-e. Either remove the definition file or change the
$fish_function_path variable to remove autoloaded functions.
Function copies, created with -c, will not have any event/signal/on-exit
notifications that the original may have had.
The exit status of the functions builtin is the number functions
specified in the argument list that do not exist.

View File

@@ -1,5 +1,4 @@
\section help help - Display fish documentation
\section help help - display fish documentation
\subsection help-synopsis Synopsis
<tt>help [SECTION]</tt>
@@ -8,8 +7,11 @@
The \c help command is used to display a section of the fish help documentation.
If the BROWSER environment variable is set, it will be used to display
the documentation, otherwise fish will search for a suitable browser.
If the BROWSER environment variable is set, it will be used to display the
documentation, otherwise fish will search for a suitable browser.
Note also that most builtin commands display their help in the terminal when
given the <tt>--help</tt> option.
\subsection help-example Example

View File

@@ -1,13 +1,23 @@
\section if if - Conditionally execute a command
\section if if - conditionally execute a command
\subsection if-synopsis Synopsis
<tt>if CONDITION; COMMAND_TRUE [else; COMMAND_FALSE] end;</tt>
<tt>if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end</tt>
\subsection if-description Description
<tt>if</tt> will execute the command CONDITION. If the commands exit
status is zero, the command COMMAND_TRUE will execute. If it is
not zero and COMMAND_FALSE is specified, COMMAND_FALSE will be
executed.
<tt>if</tt> will execute the command CONDITION. If the condition's
exit status is 0, the commands COMMANDS_TRUE will execute. If the
exit status is not 0 and <tt>else</tt> is given, COMMANDS_FALSE will
be executed.
In order to use the exit status of multiple commands as the condition
of an if block, use <a href="#begin"><tt>begin; ...; end</tt></a> and
the short circuit commands <a href="commands.html#and">and</a> and <a
href="commands.html#or">or</a>.
The exit status of the last foreground command to exit can always be
accessed using the <a href="index.html#variables-status">$status</a>
variable.
\subsection if-example Example
@@ -19,5 +29,5 @@ else
end
</pre>
will print <tt>foo.txt exists</tt> if the file foo.txt
exists and is a regular file, otherwise it will print
exists and is a regular file, otherwise it will print
<tt>foo.txt does not exist</tt>.

1443
doc_src/index.hdr.in Normal file

File diff suppressed because it is too large Load Diff

12
doc_src/isatty.txt Normal file
View File

@@ -0,0 +1,12 @@
\section isatty isatty - test if the specified file descriptor is a tty
\subsection isatty-synopsis Synopsis
<tt>isatty [FILE DESCRIPTOR]</tt>
where FILE DESCRIPTOR may be either the number of a file descriptor, or one
of the strings stdin, stdout and stderr.
If the specified file descriptor is a tty, the exit status of the
command is zero, otherwise, it is non-zero.

View File

@@ -1,18 +1,19 @@
\section jobs jobs - print currently running jobs
\subsection jobs-synopsis
<tt>jobs [OPTIONS] [PID]</tt>
<code>jobs [OPTIONS] [PID]</code>
\subsection jobs-description Description
The <tt>jobs</tt> builtin causes fish to print a list of the currently
The <code>jobs</code> builtin causes fish to print a list of the currently
running jobs and their status.
jobs accepts the following switches:
- <tt>-c</tt> or <tt>--command</tt> print the command name for each process in jobs
- <tt>-g</tt> or <tt>--group</tt> only print the group id of each job
- <tt>-l</tt> or <tt>--last</tt> only the last job to be started is printed
- <tt>-p</tt> or <tt>--process</tt> print the process id for each process in all jobs
- <code>-c</code> or <code>--command</code> print the command name for each process in jobs
- <code>-g</code> or <code>--group</code> only print the group id of each job
- <code>-h</code> or <code>--help</code> display a help message and exit
- <code>-l</code> or <code>--last</code> only the last job to be started is printed
- <code>-p</code> or <code>--pid</code> print the process id for each process in all jobs
On systems that supports this feature, jobs will print the CPU usage
of each job since the last command was executed. The CPU usage is

984
doc_src/license.hdr Normal file
View File

@@ -0,0 +1,984 @@
/** \page license Licenses
<h2>License for fish</h2>
Fish Copyright (C) 2005-2009 Axel Liljencrantz. Fish is released under
the GNU General Public License, version 2. The license agreement is
included below.
<H2><A NAME="SEC1" HREF="gpl.html#TOC1">GNU GENERAL PUBLIC LICENSE</A></H2>
<P>
Version 2, June 1991
</P>
<PRE>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</PRE>
<H2><A NAME="SEC2" HREF="gpl.html#TOC2">Preamble</A></H2>
<P>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
</P>
<P>
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
</P>
<P>
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
</P>
<P>
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
</P>
<P>
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
</P>
<P>
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
</P>
<P>
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
</P>
<P>
The precise terms and conditions for copying, distribution and
modification follow.
</P>
<H2><A NAME="SEC3" HREF="gpl.html#TOC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</A></H2>
<P>
<STRONG>0.</STRONG>
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
<P>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
<P>
<STRONG>1.</STRONG>
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
<P>
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
<P>
<STRONG>2.</STRONG>
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
<P>
<DL>
<DT>
<DD>
<STRONG>a)</STRONG>
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
</DD>
</DT>
</DL>
<P>
<DL>
<DT>
<DD>
<STRONG>b)</STRONG>
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
</DD>
</DT>
</DL>
<P>
<DL>
<DT>
<DD>
<STRONG>c)</STRONG>
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
</DD>
</DT>
</DL>
<P>
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
<P>
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
<P>
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
<P>
<STRONG>3.</STRONG>
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
<!-- we use this doubled UL to get the sub-sections indented, -->
<!-- while making the bullets as unobvious as possible. -->
<DL>
<DT>
<DD>
<STRONG>a)</STRONG>
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
</DD>
</DT>
</DL>
<P>
<DL>
<DT>
<DD>
<STRONG>b)</STRONG>
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
</DD>
</DT>
</DL>
<P>
<DL>
<DT>
<DD>
<STRONG>c)</STRONG>
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
</DD>
</DT>
</DL>
<P>
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
<P>
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
<P>
<STRONG>4.</STRONG>
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
<P>
<STRONG>5.</STRONG>
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
<P>
<STRONG>6.</STRONG>
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
<P>
<STRONG>7.</STRONG>
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
<P>
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
<P>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
<P>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
<P>
<STRONG>8.</STRONG>
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
<P>
<STRONG>9.</STRONG>
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
<P>
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
<P>
<STRONG>10.</STRONG>
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
<P><STRONG>NO WARRANTY</STRONG></P>
<P>
<STRONG>11.</STRONG>
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
<P>
<STRONG>12.</STRONG>
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
<P>
<HR>
<h2>License for wcslcat and wcslcpy</h2>
\c fish also contains small amounts of code under the BSD
license, namely versions of the two functions strlcat and strlcpy,
modified for use with wide character strings. This code is copyrighted
by Todd C. Miller.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
<HR>
<h2>License for XSel</h2>
The XSel command, written and copyrighted by Conrad Parker, is
distributed together with \c fish.
It is Copyright (C) 2001 Conrad Parker <conrad@vergenet.net>
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation. No representations are made about the
suitability of this software for any purpose. It is provided "as is"
without express or implied warranty.
<HR>
<h2>License for xdgmime and glibc</h2>
The xdgmime library, written and copyrighted by Red Hat, Inc, is used
by the mimedb command, which is a part of fish. It is released under
the LGPL, version 2 or later, or under the Academic Free License,
version 2. Version 2 of the LGPL license agreement is included below.
Fish contains code from the glibc library, namely the wcstok
function. This code is licensed under the LGPL, version 2 or
later. Version 2 of the LPGL license agreement is included below.
<H2><A NAME="SEC1" HREF="#TOC1">GNU LESSER GENERAL PUBLIC LICENSE</A></H2>
<P>
Version 2.1, February 1999
<P>
<PRE>
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
</PRE>
<H2><A NAME="SEC2" HREF="#TOC2">Preamble</A></H2>
<P>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
<P>
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
<P>
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
<P>
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
<P>
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
<P>
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
<P>
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
<P>
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
<P>
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
<P>
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
<P>
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
<P>
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
<P>
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
<P>
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
<P>
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
<P>
<H2><A NAME="SEC3" HREF="#TOC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</A></H2>
<P>
<STRONG>0.</STRONG>
This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
<P>
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
<P>
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
<P>
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
<P>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
<P>
<STRONG>1.</STRONG>
You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
<P>
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
<P>
<STRONG>2.</STRONG>
You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
<P>
<UL>
<LI><STRONG>a)</STRONG>
The modified work must itself be a software library.
<LI><STRONG>b)</STRONG>
You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
<LI><STRONG>c)</STRONG>
You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
<LI><STRONG>d)</STRONG>
If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
<P>
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
<P>
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
<P>
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
<P>
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
</UL>
<P>
<STRONG>3.</STRONG>
You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
<P>
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
<P>
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
<P>
<STRONG>4.</STRONG>
You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
<P>
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
<P>
<STRONG>5.</STRONG>
A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
<P>
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
<P>
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
<P>
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
<P>
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
<P>
<STRONG>6.</STRONG>
As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
<P>
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
<P>
<UL>
<LI><STRONG>a)</STRONG> Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
<LI><STRONG>b)</STRONG> Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
<LI><STRONG>c)</STRONG> Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
<LI><STRONG>d)</STRONG> If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
<LI><STRONG>e)</STRONG> Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
</UL>
<P>
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
<P>
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
<P>
<STRONG>7.</STRONG> You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
<P>
<UL>
<LI><STRONG>a)</STRONG> Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
<LI><STRONG>b)</STRONG> Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
</UL>
<P>
<STRONG>8.</STRONG> You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
<P>
<STRONG>9.</STRONG>
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
<P>
<STRONG>10.</STRONG>
Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
<P>
<STRONG>11.</STRONG>
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
<P>
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
<P>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
<P>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
<P>
<STRONG>12.</STRONG>
If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
<P>
<STRONG>13.</STRONG>
The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
<P>
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
<P>
<STRONG>14.</STRONG>
If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
<P>
<STRONG>NO WARRANTY</STRONG>
<P>
<STRONG>15.</STRONG>
BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
<P>
<STRONG>16.</STRONG>
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
<P>
*/

20
doc_src/math.txt Normal file
View File

@@ -0,0 +1,20 @@
\section math math - Perform mathematics calculations
\subsection math-synopsis Synopsis
<tt>math EXPRESSION</tt>
\subsection math-description Description
math is used to perform mathematical calculations. It is only a very
thin wrapper for the bc program, that makes it possible to specify an
expression from the command line without using non-standard extensions
or a pipeline. Simply use a command like <code>math 1+1</code>.
For a description of the syntax supported by math, see the manual for
the bc program. Keep in mind that parameter expansion takes place on
any expressions before they are evaluated. This can be very useful in
order to perform calculations involving environment variables or the
output of command substitutions, but it also means that parenthesis
have to be escaped.

View File

@@ -1,12 +1,11 @@
\section mimedb mimedb - Lookup file information via the mime database
\section mimedb mimedb - lookup file information via the mime database
\subsection mimedb-synopsis Synopsis
<tt>mimedb [OPTIONS] FILES...</tt>
\subsection mimedb-description Description
- \c FILES is a list of files to analyse
- \c FILES is a list of files to analyse
- \c -t, \c --input-file-data the specified files type should be determined both by their filename and by their contents (Default)
- \c -f, \c --input-filename the specified files type should be determined by their filename
- \c -i, \c --input-mime the arguments are not files but mimetypes
@@ -14,6 +13,13 @@
- \c -f, \c --output-description the output will be the description of each mimetype
- \c -a, \c --output-action the output will be the default action of each mimetype
- \c -l, \c --launch launch the default action for the specified file(s)
- \c -h, \c --help Display a help message and exit
- \c -v, \c --version Display version number and exit
- \c -h, \c --help display a help message and exit
- \c -v, \c --version display version number and exit
The mimedb command is used to query the mimetype database and the
.desktop files installed on the system in order to find information on
a file. The information that mimedb can retrieve includes the mimetype
for a file, a description of the type and what its default action
is. mimedb can also be used to launch the default action for this
file.

View File

@@ -1,10 +1,10 @@
\section nextd nextd
\section nextd nextd - move forward through directory history
\subsection nextd-synopsis Synopsis
<tt>nextd [-l | --list] [pos]</tt>
\subsection nextd-description Description <tt>nextd</tt> moves
forwards <tt>pos</tt> positions in the history of visited directories;
if the end of the history has been hit, a warning is printed. If the
<code>-l></code> or <code>--list</code> flag is specified, the current
\subsection nextd-description Description
<tt>nextd</tt> moves forwards <tt>pos</tt> positions in the history of visited
directories; if the end of the history has been hit, a warning is printed. If
the <code>-l></code> or <code>--list</code> flag is specified, the current
history is also displayed.

View File

@@ -1,13 +1,11 @@
\section not not - Negate the exit status of a job
\section not not - negate the exit status of a job
\subsection not-synopsis Synopsis
<tt>not COMMAND [OPTIONS...]</tt>
<tt>not COMMAND [OPTIONS...]</tt>
\subsection not-description Description
The \c not builtin is used to negate the exit status of another command.
The \c not builtin is used to negate the exit status of another command.
\subsection not-example Example

View File

@@ -1,13 +1,12 @@
\section open open - Open file in it's default application
\section open open - open file in its default application
\subsection open-synopsis Synopsis
<tt>open FILES...</tt>
\subsection open-description Description
The \c open command is used to open a file in it's default application. \c open is implemented using the <a href="commands.html#mimedb">mimedb</a> command.
The \c open command is used to open a file in its default application. \c open is implemented using the \c xdg-open command if it exists, or else the <a href="commands.html#mimedb">mimedb</a> command.
\subsection open-example Example
<tt>open *.txt</tt> opens all the text files in the current directory using your systems default text editor.
<tt>open *.txt</tt> opens all the text files in the current directory using your system's default text editor.

View File

@@ -1,17 +1,27 @@
\section or or - Conditionally execute a command
\section or or - conditionally execute a command
\subsection or-synopsis Synopsis
<tt>COMMAND1; or COMMAND2</tt>
\subsection or-description Description
The \c or builtin is used to execute a command if the current exit status (as set by the last previous command) is non-zero
The \c or builtin is used to execute a command if the current exit
status (as set by the last previous command) is not 0.
The or command does not change the current exit status.
The exit status of the last foreground command to exit can always be
accessed using the <a href="index.html#variables-status">$status</a>
variable.
\subsection or-example Example
The following code runs the \c make command to build a program, or if it fails, it runs <tt>make clean</tt>, which removes the files created by the build process
The following code runs the \c make command to build a program, if the
build succeeds, the program is installed. If either step fails,
<tt>make clean</tt> is run, which removes the files created by the
build process
<pre>
make; or make clean
make; and make install; or make clean
</pre>

View File

@@ -1,8 +1,8 @@
\section popd popd
\section popd popd - move through directory stack
\subsection popd-synopsis Synopsis
<tt>popd</tt>
\subsection popd-description Description
<tt>popd</tt> removes the top directory from the directory stack and
\subsection popd-description Description
<tt>popd</tt> removes the top directory from the directory stack and
cd's to the new top directory.

View File

@@ -1,10 +1,11 @@
\section prevd prevd
\section prevd prevd - move backward through directory history
\subsection prevd-synopsis Synopsis
<tt>prevd [-l | --list] [pos]</tt>
\subsection prevd-description Description <tt>prevd</tt> moves
backwards <tt>pos</tt> positions in the history of visited
directories; if the beginning of the history has been hit, a warning
is printed. If the <code>-l</code> or <code>--list</code> flag is
specified, the current history is also displayed.
\subsection prevd-description Description
<tt>prevd</tt> moves backwards <tt>pos</tt> positions in the history
of visited directories; if the beginning of the history has been hit,
a warning is printed. If the <code>-l</code> or <code>--list</code>
flag is specified, the current history is also displayed.

View File

@@ -1,8 +1,7 @@
\section psub psub - Perform process substitution
\section psub psub - perform process substitution
\subsection psub-synopsis Synopsis
<tt>COMMAND1 (COMMAND2|psub) </tt>
<tt>COMMAND1 (COMMAND2|psub [-f]) </tt>
\subsection psub-description Description
@@ -15,6 +14,12 @@ filename of the named pipe sent as an argument to the calling
program. The psub shellscript function, which when combined with a
regular command substitution provides the same functionality.
If the \c -f or \c --file switch is given to psub, psub will use a
regular file instead of a named pipe to communicate with the calling
process. This will cause psub to be significantly slower when large
amounts of data are involved, but has the advantage that the reading
process can seek in the stream.
\subsection psub-example Example
<tt>diff (sort a.txt|psub) (sort b.txt|psub)</tt> shows the difference

Some files were not shown because too many files have changed in this diff Show More