Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Sampler
Commits
9c00af5e
Commit
9c00af5e
authored
5 years ago
by
sqshq
Browse files
Options
Download
Email Patches
Plain Diff
cleanup escape codes for regular and interactive shell sampling
parent
5b0b2291
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
data/int_basic.go
+2
-1
data/int_basic.go
data/item.go
+4
-1
data/item.go
with
6 additions
and
2 deletions
+6
-2
data/int_basic.go
+
2
-
1
View file @
9c00af5e
...
...
@@ -4,6 +4,7 @@ import (
"bufio"
"errors"
"fmt"
"github.com/lunixbochs/vtclean"
"io"
"os/exec"
"strings"
...
...
@@ -118,7 +119,7 @@ func (s *BasicInteractiveShell) execute() (string, error) {
if
errorText
.
Len
()
>
0
{
return
""
,
errors
.
New
(
errorText
.
String
())
}
return
s
.
item
.
transform
(
resultText
.
String
())
return
s
.
item
.
transform
(
vtclean
.
Clean
(
resultText
.
String
()
,
false
)
)
}
}
}
This diff is collapsed.
Click to expand it.
data/item.go
+
4
-
1
View file @
9c00af5e
...
...
@@ -2,6 +2,7 @@ package data
import
(
ui
"github.com/gizak/termui/v3"
"github.com/lunixbochs/vtclean"
"github.com/sqshq/sampler/config"
"os"
"os/exec"
...
...
@@ -70,7 +71,9 @@ func (i *Item) execute(variables []string, script string) (string, error) {
return
""
,
err
}
return
string
(
output
),
nil
o
:=
string
(
output
)
return
vtclean
.
Clean
(
o
,
false
),
nil
}
func
(
i
*
Item
)
initInteractiveShell
(
v
[]
string
)
error
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help