Closed CyrilOtheninGirard closed 2 years ago
Defining PROMPT_COMMAND as a single function call ALSO simplifies a lot the integration of pureline with other prompt-modifying tools.
For example, without FIX-2, the 'shell integration' feature of vscode integrated terminals does not work when using pureline :
With FIX-2, it works again :
[FIX-1] function 'pureline_pre' now returns the saved error code of the last executed command. => Does not break an inherited PROMPT_COMMAND that requires that value.
[FIX-2] Defines PROMPT_COMMAND as a call to a single function, which is dynamically generated using 'eval' in a robust way, so as to work whatever the content of the inherited PROMPT_COMMAND. => No need to strip trailing whitespaces => No need to check/add a trailing semicolon => No need to handle any other (undiscovered) special case
Note: the "new" function is called 'pureline_ps1', while the "old" one is renamed 'pureline_post'.