summaryrefslogtreecommitdiffstats
path: root/CHANGELOG
blob: 181efc67c5bad18a63739afbc720ced15e362878 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
CHANGELOG
=========

1.0.8: 2016-10-16
-----------------

Fixes:
- In 'shortcuts': complete_while_typing was a SimpleFilter, not a CLIFilter.
- Always reset color attributes after rendering.
- Handle bug in Windows when '$TERM' is not defined.
- Ignore errors when calling tcgetattr/tcsetattr.
  (This handles the "Inappropriate ioctl for device" crash in some scenarios.)
- Fix for Windows. Correctly recognize all Chinese and Lithuanian characters.

New features:
- Added shift+left/up/down/right keys.
- Small performance optimization in the renderer.
- Small optimization in the posix event loop. Don't call time.time() if we
  don't have an inputhook. (Less syscalls.)
- Turned the _max_postpone_until argument of call_from_executor into a float.
  (As returned by `time.time`.) This will do less system calls. It's
  backwards-incompatible, but this is still a private API, used only by pymux.)
- Added Shift-I/A commands in Vi block selection mode for inserting text at the
  beginning of each line of the block.
- Refactoring of the 'selectors' module for the posix event loop. (Reuse the
  same selector object in one loop, don't recreate it for each select.)


1.0.7: 2016-08-21
-----------------

Fixes:
- Bugfix in completion. When calculating the common completion to be inserted,
  the new completions were calculated wrong.
- On Windows, avoid extra vertical scrolling if the cursor is already on screen.

New features:
- Support negative arguments for next/previous word ending/beginning.


1.0.6: 2016-08-15
-----------------

Fixes:
- Go to the start of the line in Vi nagivation mode, when 'j' or 'k' have been
  pressed to navigate to a new history entry.
- Don't crash when pasting text that contains \r\n characters. (This could
  happen in iTerm2.)
- Python 2.6 compatibility fix.
- Allow pressing <esc> before each -ve argument.
- Better support for conversion from #ffffff values to ANSI colors in
  Vt100_Output.
    * Prefer colors with some saturation, instead of gray colors, if the given
      color was not gray.
    * Prefer a different foreground and background color if they were
      originally not the same. (This avoids concealing text.)

New features:
- Improved ANSI color support.
    * If the $PROMPT_TOOLKIT_ANSI_COLORS_ONLY environment variable has been
      set, use the 16 ANSI colors only.
    * Take an `ansi_colors_only` parameter in `Vt100_Output` and
      `shortcuts.create_output`.


1.0.5: 2016-08-04
-----------------

Fixes:
- Critical fix for running on Windows. The gevent work-around in the inputhook
  caused 'An operation was attempted on something that is not a socket'.


1.0.4: 2016-08-03
-----------------

Fixes:
- Key binding fixes:
      * Improved handling of repeat arguments in Emacs mode. Pressing sequences
        like 'esc---123' do now work (like GNU Readline):
              - repetition of the minus sign is ignored.
              - No esc prefix is required for each digit.
      * Fix in ControlX-ControlX binding.
      * Fix in bracketed paste.
      * Pressing Control-U at the start of the line now deletes the newline.
      * Pressing Control-K at the end of the line, deletes the newline after
        the cursor.
      * Support negative argument for Control-K
      * Fixed cash when left/right were pressed with a negative argument. (In
        Emacs mode.)
      * Fix in ControlUp/ControlDown key bindings.
      * Distinguish backspace from Control-H. They are not the same.
      * Delete in front of the cursor when a negative argument has been given
        to backspace.
      * Handle arrow keys correctly in emacs-term.
- Performance optimizations:
      * Performance optimization in Registry.
      * Several performance optimization in filters.
      * Import asyncio inline (only if required).
- Use the best possible selector in the event loop. This fixes bugs in
  situations where we have too many open file descriptors.
- Fix UI freeze when gevent monkey patch has been applied.
- Fix segmentation fault in Alpine Linux. (Regarding the use of ioctl.)
- Use the correct colors on Windows. (When the foreground/background colors
  have been modified.)
- Display a better error message when running in Idle.
- Additional flags for vt100 inputs: disable flow control.
- Also patch stderr in CommandLineInterface.patch_stdout_context.

New features:
- Allow users to enter Vi digraphs in reverse order.
- Improved autocompletion behaviour. See IPython issue #9658.
- Added a 'clear' function in the shortcuts module.

For future compatibility:
- `Keys.Enter` has been added. This is the key that should be bound for
  handling the enter key.

  Right now, prompt_toolkit translates \r into \n during the handling of the
  input; this is not correct and makes it impossible to distinguish between
  ControlJ and ControlM. Some applications bind ControlJ for custom handling of
  the enter key, because this equals \n. However, in a future version we will
  stop replacing \r by \n and at that point, the enter key will be ControlM. 
  So better is to use `Keys.Enter`, which becomes an alias for whatever the
  enter key translates into.


1.0.3: 2016-06-20
-----------------

Fixes:
- Bugfix for Python2 in readline-like completion.
- Bugfix in readline-like completion visualisation.

New features:
- Added `erase_when_done` parameter to the `Aplication` class.  (This was
  required for the bug fixes.)
- Added (experimental) `CommandLineInterface.run_application_generator` method.
  (Also required for the bug fix.)

1.0.2: 2016-06-16
-----------------

Fixes:
- Don't select the first completion when `complete_while_typing` is False.
  (Restore the old behaviour.)


1.0.1: 2016-06-15
-----------------

Fixes:
- Bugfix in GrammarValidator and SentenceValidator.
- Don't leave the alternate screen on resize events.
- Use errors=surrogateescape, in order to handle mouse events in some
  terminals.
- Ignore key presses in _InterfaceEventLoopCallbacks.feed_key when the CLI is in the done state.
- Bugfix in get_common_complete_suffix. Don't return any suffix when there are
  completions that change whatever is before the cursor.
- Bugfix for Win32/Python2: use unicode literals: This crashed arrow navigation
  on Windows.
- Bugfix in InputProcessor: handling of more complex key bindings.
- Fix: don't apply completions, if there is only one completion which doesn't
  have any effect.
- Fix: correctly handle prompts starting with a newline in
  prompt_toolkit.shortcuts.
- Fix: thread safety in autocomplete code.
- Improve styling for matching brackets. (Allow individual styling for the
  bracket under the cursor and the other.)
- Fix in ShowLeadingWhiteSpaceProcessor/ShowTrailingWhiteSpaceProcessor: take
  output encoding into account. (The signature had to change a little for
  this.)
- Bug fix in key bindings: only activate Emacs system/open-in-editor bindings
  if editing_mode is emacs.
- Added write_binary parameter to Vt100_Output. This fixes a bug in some cases
  where we expect it to write non-encoded strings.
- Fix key bindings for Vi mode registers.

New features (**):
- Added shortcuts.confirm/create_confirm_application function.
- Emulate bracketed paste on Windows. (When the input stream contains multiple
  key presses among which a newline and at least one other character, consider
  this a paste event, and handle as bracketed paste on Unix.
- Added key handler for displaying completions, just like readline does.
- Implemented Vi guu,gUU,g~~ key bindings.
- Implemented Vi 'gJ' key binding.
- Implemented Vi ab,ib,aB,iB text objects.
- Support for ZeroWidthEscape tokens in prompt and token lists. Used to support
  final shell integration.
- Fix: Make document.text/cursor_position/selection read-only. (Changing these
  would break the caching causing bigger issues.)
- Using pytest for unit tests.
- Allow key bindings to have Keys.Any at any possible position. (Not just the
  end.) This made it significantly easier to write the named register Vi
  bindings, resulting in an approved start-up time.)
- Better feedback when entering multi-key key bindings in insert mode. (E.g.
  when 'jj' would be mapped to escape.)
- Small improvement in key processor: allow key bindings to generate new key
  presses.
- Handle ControlUp and ControlDown by default: move to the previous/next record
  in the history.
- Accept 'char'/'get_char' parameters in FillControl.
- Added refresh_interval method to prompt() function.

Performance improvements:
- Improve the performance of test_callable_args: this should significantly
  increase the start-up time.
- Start-up time for creating the Vi bindings has been improved significantly.

(**) Some small backwards-compatible features were allowed for this minor
     release. After evaluating the impact/risk/work involved we concluded that
     we could ship these in a minor release.


1.0.0: 2016-05-05
-----------------

Fixes:
- Adjust minimum completion menu width to match UIControl and Window class.
- Bugfix regarding weakref in InputProcessor.
- Fix for pypy3: bug in WeakValueDictionary.
- Correctly handle '0' key binding in Vi mode.
- Also load Vi bindings by default in Application if no registry has been given.
- Only go into selection mode if the current buffer is not empty.
- Close PipeInput after usage.
- Only use 16 colors in (Emacs) eterm-color.
- Bugfix in "xP Vi key binding.
- Bugfix in Vi { and } key binding.
- Fix: use correct token for Scrollbar in MultiColumnCompletionMenuControl.
- Handle negative values in translate_row_col_to_index.
- Handle decomposed unicode characters.
- Fixed Window.always_hide_cursor. (Parameter was ignored.)
- Fix in zz Vi key binding. (When render info is not available.)
- Fix in Document.get_cursor_up_position. (When an argument is given.)

New features:
- Separated `load_mouse_bindings`.
- Refactoring/simplification of the key bindings: better use of filters and
  CLI.editing_mode.
- Added DummyOutput class and a few unit tests that test the whole CLI.
- Use the bisect module in Document._line_start_indexes instead of a custom
  binary search. This should improve the performance.
- Stay in the same column when doing multiple up/down movements.
- Visual improvements:
  * Implemented cursorcolumn, cursorline and colorcolumn.
  * Only reserve menu space when `complete_while_typing=True` or when there are
    completions to be displayed.
  * Support for chaining tokens for combined styles. SelectedText will now
    reverse the colors from the highlighting by default. Style
    `Token.SelectedText` to set a fixed foreground/background.
    Also for SearchMatch, we now use combined tokens.
  * Support for dark gray on Windows.
  * Default token for SystemToolbar and SearchToolbar.
  * Display selection also on empty lines.
- Emacs key bindings improved:
  * Recognize + handle ControlDelete key.
  * Implemented meta-* and control-backslash key bindings.
- Vi key bindings improved:
  * Handle inclusive and linewise motions properly.
  * Fix g_ motion off by one character, and don't work when cursor is in
    the trailing whitespace part of line.
  * Make a(/a)/i(/i)/... motions. Find enclosing brackets instead of the next
    bracket.
  * Update N% motion according to vim behaviors.
  * Fix | motion off by one character.
  * ge/gE motions go to end of previous word, not start.
  * Added Vi 'gm' key binding.
  * Implemented 'gq' key binding in Vi mode. (Reshape text.)
  * Vi operator/text object separation for key bindings.
  * Added 'ap' (auto-paragraph) text object.
  * Implemented Vi digraphs. ControlK will now insert a digraph.
  * Implemented vi tilde_operator.
  * Support named registers.
  * Vi < and > key bindings became operators.
  * Text objects and motions are now separate bindings.
  * Improved copy/paste in Vi mode.

Backwards-incompatible changes:
- Don't reset the current buffer anymore by default in
  CommandLineInterface.run(). Passing `reset_current_buffer=True` is now
  required.
- Renamed MouseEventTypes to MouseEventType for consistency. The old name is
  still valid, but deprecated.
- Refactoring of Callbacks. All events should now receive one argument, which
  is the sender. (Furter, Callback was renamed to Event.) This is mostly used
  internally.
- Moved on_invalidate callback from CommandLineInterface to Application
- Renamed `PipeInput.send` to `PipeInput.send_text`. (Old deprecated name is
  still kept as a valid alias.)
- Renamed SimpleLexer.default_token to SimpleLexer.token. (+
  backwards-compatibility.)
- Refactoring of the filters: `ViStateFilter` has been deprecated. (Should not
  be used anymore.) Use the filters, as defined in prompt_toolkit.filters.
- `editing_mode` is now a property of `CommandLineInterface`. This is replacing
  the `vi_mode` parameter in `KeyBindingManager`.
- The default accept_action for the default Buffer in Application now becomes
  IGNORE. This is a much more sensible default. Pass RETURN_DOCUMENT to get
  the previous behaviour,
- Always expect an EventLoop instance in CommandLineInterface. Creating it in
  __init__ caused a memory leak.


0.60: 2016-03-14
----------------

Fixes:
- Fix in Document.paste. (The screen was not updated after an undo of a paste.)
- Don't use deprecated inspect.getargspec on Python 3.
- Fixed reading input on Windows when input was piped in stdin.
- Use correct file descriptors for input/output in run_system_command.
- Always correctly split prompt in shortcuts.prompt. (Even when multiline=False)
- Correctly align right prompt to the top when the left prompt consists of
  multiple lines.
- Correctly use Token.Transparent as default token for a TokenListControl.
- Fix in syntax synchronisation. (Better handle the case when no
  synchronisation point was found.)
- Send SIGTSTP to the whole process group.
- Correctly raise on_buffer_changed on all text changes.
- Fix in regular_languages.GrammarLexer. (Fixes bug in ptipython syntax
  highlighting.)

New features:
- Add support for additional readers to the Win32 event loop.
- Added on_render event.
- Carry the weight in layout dimensions to allow stretching.


0.59: 2016-02-27
----------------

Fixes:
- Set correct default color on Windows. (Gray instead of high intensity gray.)
- Reverse colors on Windows when foreground/background color have not been
  specified.
- Correct handling of mouse events for FillControl.
- Take margin into account when calculating Window height. (Fixes bug in
  multiline prompt.)
- Handle division by zero in UIContent.get_height_for_text.


0.58: 2016-02-23
----------------

Fixes:
- Correctly return result for mouse handler in TokenListControl.
- Bugfix in meta-backspace key binding. (Delete all whitespace before the
  cursor, when there is only whitespace.)
- Bugfix in Vi gu, gU, g? and g~ key bindings (in selection mode).
- Correctly restore default console attributes on Windows.
- Disable bracketed paste support in ConEmu. (This was broken.)
- When an unknown exception is raised in `CommandLineInterface.run()`, don't
  forget to redraw the CLI.

New features:
- Many performance improvements and better caching. (Especially in the
  `Document` class.)
- Support for continuation tokens in `shortcuts.prompt` and
  `shortcuts.create_prompt_layout`.
- Added `shortcuts.print_tokens` function for printing colored output.
- Sound bell when nothing was deleted.
- Added escape sequences for F1-F5 keys on the Linux console.
- Improved support for the Linux console. (Switch back to 16 colors.)
- Added F13-F24 input codes for xterm.
- Created prompt_toolkit.token. A custom Token implementation, that is
  compatible with Pygments.token. (This way, Pygments becomes an optional
  dependency. For many use cases, nothing except the Token class from Pygments
  was used, so it was a bit overkill to install Pygments for only that.)
- Refactoring of prompt_toolkit.styles.
- `Float` objects got a `hide_when_covering_content` option.
- Implementation of RPROMPT, like ZSH: Added `get_rprompt_tokens` to
  `create_prompt_layout`.
- Some improvements to the default style.
- Also handle Ctrl-R and Ctrl-S in Vi mode when searching.
- Added TabsProcessor: a tool to visualise tabs instead of displaying ^I.
- Give a better error message when trying to run in git-bash.
- Support for ANSI color names in style dictionaries.

- Big refactoring of the `Window` and `UIControl` classes. This should result
  in huge performance improvements on big inputs. (While first, a document
  could have 1,000 lines; now it can have about 100,000 lines on the same system.)

  The Window and UIControl have been rewritten very much. Rather than each time
  rendering the whole user control, we now only have to render the visible part.

  Because of this, many pieces had to be rewritten:
  - UIControls work differently. They return a `UIContent` instance that
    consist of a collection of lines.
  - All processors have been rewritten. (Their API changed as well, because
    they process one line at a time.)
  - Lexers work differently. `Lexer.lex_document` should now return a function
    that returns the tokens for one line. PygmentsLexer has been optimized that
    it becomes 'lazy', and it has optional syntax synchronisation. That means,
    that the lexer doesn't have to start the lexing at the beginning of the
    document. (Which would be slow for big documents.)

Backwards-incompatible changes:
- As mentioned above, the refactoring of `Window` and `UIControl` caused many
  "internal" APIs to change. All custom `UIControl`, `Processor` and `Lexer`
  classes have to be rewritten. However, for most applications this should not
  be an issue. Especially, the `shortcuts.prompt` function is
  backwards-compatible.
- `wrap_lines` became a property of `Window` instead of `BufferControl`.


0.57: 2016-01-04
----------------

Fixes:
- Made `max_render_postpone_time` configurable. The current default was bad.
  (We should probably always draw the UI once every cycle of the event loop.)


0.56: 2016-01-03
----------------

Fixes:
- Fix in bracketed paste. It was not c