<commit_before>use strict;
use warnings;

package AngelPS1::Shell::ksh93;

use AngelPS1::Shell::POSIX ();
our @ISA = ('AngelPS1::Shell::POSIX');

# ksh93 doesn't have 'local'
sub shell_local
{
    'typeset'
}

# Contrary to mksh documentation, ks93 (at least as packaged on
# Ubuntu as version 93u-1) does not support the "\001\r" trick
# So we do not overload ps1_invisible


# Called from AngelPS1::Shell::POSIX->shell_code_dynamic
sub ps1_time_debug
{
    # Note that "time -- " doesn't work (/usr/bin/time is used in that case)
    q|time |;
}

sub shell_code_dynamic
{
    my $class = shift;
    my $shell_code = $class->SUPER::shell_code_dynamic(@_);
    # Replace [ ... ] (external 'test' command) with [[ ... ]] (internal)
    $shell_code =~ s{([\[\]])}{$1$1}g;
    return $shell_code
}

'$';
# vim:set et ts=8 sw=4 sts=4:
<commit_msg>ksh: only escape '!' to '!!' in the final result<commit_after>use strict;
use warnings;

package AngelPS1::Shell::ksh93;

use AngelPS1::Shell::POSIX ();
our @ISA = ('AngelPS1::Shell::POSIX');


sub ps1_finalize
{
    (my $s = $_[1]) =~ s/!/!!/gs;
    $s
}


# ksh93 doesn't have 'local'
sub shell_local
{
    'typeset'
}

# Contrary to mksh documentation, ks93 (at least as packaged on
# Ubuntu as version 93u-1) does not support the "\001\r" trick
# So we do not overload ps1_invisible


# Called from AngelPS1::Shell::POSIX->shell_code_dynamic
sub ps1_time_debug
{
    # Note that "time -- " doesn't work (/usr/bin/time is used in that case)
    q|time |;
}

sub shell_code_dynamic
{
    my $class = shift;
    my $shell_code = $class->SUPER::shell_code_dynamic(@_);
    # Replace [ ... ] (external 'test' command) with [[ ... ]] (internal)
    $shell_code =~ s{([\[\]])}{$1$1}g;
    return $shell_code
}

'$';
# vim:set et ts=8 sw=4 sts=4:

{'fraction_non_alphanumeric': 0.16517357222844345, 'fraction_numerical': 0.026875699888017916, 'mean_word_length': 3.740053050397878, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7191663', 'n_tokens_mistral': 722, 'n_tokens_neox': 672, 'n_words': 182}