Skip to content

Instantly share code, notes, and snippets.

@wez
Created April 11, 2012 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wez/2356122 to your computer and use it in GitHub Desktop.
Save wez/2356122 to your computer and use it in GitHub Desktop.
Script started on Tue Apr 10 22:31:42 2012
% ]0;wez@W:~ 2 wez@W 22:31 ~ %(B ccd src//mosh/ 
]0;cd src/mosh -- wez@W:~% ]0;wez@W:~/src/mosh 2 wez@W 22:31 ~/src/mosh %(B vvi inneroutsrc/util/swrite.cc
]0;vi src/util/swrite.cc -- wez@W:~/src/mosh[?1002h[?1049h[?1h=[?12;25h[?12l[?25h[?25l"src/util/swrite.cc" 41L, 1283C[>c/*
Mosh: the mobile shell
Copyright 2012 Keith Winstein
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include "swrite.h"
src/util/swrite.cc 47 0x2F 1,1 Top[?12l[?25h[?25l~@k 32 0x20 2,[?12l[?25h[?25l^D int swrite( int fd, const char *str, ssize_t len )
{
ssize_t total_bytes_written = 0;
ssize_t bytes_to_write = ( len >= 0 ) ? len : (ssize_t) strlen( str );
while ( total_bytes_written < bytes_to_write ) {
ssize_t bytes_written = write( fd, str + total_bytes_written, bytes_to_write - total_bytes_written );
if ( bytes_written <= 0 ) { perror( "write" ); return -1;71 0x47 13,5 61%[?12l[?25h[?25l^D  } else { total_bytes_written += bytes_written;
}
}
return 0;
}0 0x0 24,0-1 Bot[?12l[?25h[?25l^U  (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/71 0x47 13,5 38%[?12l[?25h[?25l^U /*
Mosh: the mobile shell
Copyright 2012 Keith Winstein
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or 77 0x4D 2,5 Top[?12l[?25h[?25l^U 47 0x2F 1,1 [?12l[?25h[?25l^U [?12l[?25h[?25l::[?12l[?25hq[?25l[?12l[?25h [?25l[?1002l[?1l>[?12l[?25h[?1049l% ]0;wez@W:~/src/mosh 2 wez@W 22:31 ~/src/mosh %(B 
Script done on Tue Apr 10 22:32:00 2012
Script started on Tue Apr 10 22:31:35 2012
% ]0;wez@W:~/src/mosh 2 wez@W 22:31 ~/src/mosh %(B mmosh localhost
]0;mosh localhost -- wez@W:~/src/mosh
[?1h]0;\[?5l[?25l[?25h]0;[mosh] \]0;[mosh] wez@W:~\wez@W 22:31 ~ % script inner]0;[mosh] script inner -- wez@W:~\[?25lScript started, output file is inner[?25h]0;[mosh] wez@W:~\2 wez@W 22:31 ~ % cd src/[?25l/m[?25hosh/]0;[mosh] wez@W:~/src/mosh\[?25l 2 wez@W 22:31 ~/src/mosh % [?25hvi inner[?25lout[?25h[?25lsrc/util/swrite.cc[?25h]0;[mosh] vi src/util/swrite.cc -- wez@W:~/src/mosh\[?25l
"src/util/swrite.cc" 41L, 1283C/* Mosh: the mobile shell Copyright 2012 Keith Winstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.*/#include <unistd.h>#include <string.h>#include <stdio.h>#include "swrite.h"src/util/swrite.cc 47 0x2F 1,1 Top[?25h[?25l3202 [?25h[?25l
int swrite( int fd, const char *str, ssize_t len ){ ssize_t total_bytes_written = 0; ssize_t bytes_to_write = ( len >= 0 ) ? len : (ssize_t) strlen( str ); while ( total_bytes_written < bytes_to_write ) { ssize_t bytes_written = write( fd, str + total_bytes_written, bytes_to_write - total_bytes_written ); if ( bytes_written <= 0 ) { perror( "write" ); return -1;71 0x47 13561%[?25h[?25l
 } else { total_bytes_written += bytes_written; } } return 0;}0 0x0 24,0-1Bot [?25h[?25l (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.*/#include <unistd.h>#include <string.h>#include <stdio.h>#include "swrite.h"int swrie( int fd, constchar *str, ssize_t len ){ssize_t total_bytes_written = 0; ssize_t bytes_to_write = ( len >= 0 ) ? len : (ssize_t) strlen( str );while ( total_bytes_written < bytes_to_write ) { ssize_t bytes_written = write( fd, str + total_bytes_written,71 0x47 13,538%[?25h[?25l/* Mosh: the mobile shellCopyright 2012 Keth WinsteinThis program isfee software:you can redistribute it and/or modifyit under the termsof the GNU General Pubic License as published by the Free Software Foundation, either version 3 of the License, or(atyour option) any laterversin. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.*/#include <unistd.h>#include <string.h>#include <stdio.h>#include "swrite.h" 77 0x4D 2Top[?25h[?25l42F11[?25h[?25l:[?25hq]0;[mosh] wez@W:~/src/mosh\[?25l2 wez@W 22:31 ~/src/mosh % [?25h]0;[mosh] wez@W:~\[?25l
Script done, output file is innerwez@W 22:32 ~ % [?25h[?25l
[?25h]0;wez@W:~\[?1l
[mosh is exiting.]
% ]0;wez@W:~/src/mosh 2 wez@W 22:32 ~/src/mosh %(B 
Script done on Tue Apr 10 22:32:02 2012

Github, y u no allow attachments on issues????

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment