340 |
364 |
341 " |
365 " |
342 TerminalApplication open |
366 TerminalApplication open |
343 TerminalApplication openIn:'/etc' |
367 TerminalApplication openIn:'/etc' |
344 " |
368 " |
|
369 ! ! |
|
370 |
|
371 !TerminalApplication methodsFor:'aspects'! |
|
372 |
|
373 keepSSHConnectionAliveHolder |
|
374 keepAlive isNil ifTrue:[ |
|
375 keepAlive := false asValue. |
|
376 keepAlive onChangeSend:#keepSSHConnectionAliveHolderChanged to:self. |
|
377 ]. |
|
378 ^ keepAlive |
|
379 |
|
380 "Created: / 30-07-2013 / 07:51:59 / cg" |
345 ! ! |
381 ! ! |
346 |
382 |
347 !TerminalApplication methodsFor:'menu-actions'! |
383 !TerminalApplication methodsFor:'menu-actions'! |
348 |
384 |
349 addWorkspace |
385 addWorkspace |
404 file size > 0 ifTrue:[ |
456 file size > 0 ifTrue:[ |
405 self playbackFile:file |
457 self playbackFile:file |
406 ] |
458 ] |
407 ! |
459 ! |
408 |
460 |
|
461 noColors |
|
462 ^ self selectedWorkspacesTextView noColors |
|
463 ! |
|
464 |
|
465 noColors:aBoolean |
|
466 self selectedWorkspacesTextView noColors:aBoolean. |
|
467 ! |
|
468 |
409 openDocumentation |
469 openDocumentation |
410 "opens the documentation file" |
470 "opens the documentation file" |
411 |
471 |
412 self openHTMLDocument: 'tools/misc/TOP.html#TERMINAL' |
472 self openHTMLDocument: 'tools/misc/TOP.html#TERMINAL' |
413 ! |
473 ! |
432 |
492 |
433 setNormalDisplayMode |
493 setNormalDisplayMode |
434 self selectedWorkspacesTextView setNormalDisplayMode. |
494 self selectedWorkspacesTextView setNormalDisplayMode. |
435 ! |
495 ! |
436 |
496 |
|
497 setRedDisplayMode |
|
498 self selectedWorkspacesTextView setRedDisplayMode. |
|
499 ! |
|
500 |
437 setReverseDisplayMode |
501 setReverseDisplayMode |
438 self selectedWorkspacesTextView setReverseDisplayMode. |
502 self selectedWorkspacesTextView setReverseDisplayMode. |
439 ! ! |
503 ! ! |
440 |
504 |
441 !TerminalApplication methodsFor:'private'! |
505 !TerminalApplication methodsFor:'private'! |
442 |
506 |
443 isModifiedWorkspace:aView |
507 isModifiedWorkspace:aView |
444 ^ false |
508 ^ false |
|
509 ! |
|
510 |
|
511 startKeepAliveProcess |
|
512 "keep alive, by sending a return from time to time. |
|
513 Raise to top, if connection is lost" |
|
514 |
|
515 keepAliveProcess isNil ifTrue:[ |
|
516 keepAliveProcess := |
|
517 [ |
|
518 [true] whileTrue:[ |
|
519 self selectedWorkspacesTextView sendCR:''. |
|
520 Delay waitForSeconds:30. |
|
521 ]. |
|
522 ] newProcess. |
|
523 keepAliveProcess resume. |
|
524 ]. |
|
525 |
|
526 "Created: / 30-07-2013 / 09:14:36 / cg" |
|
527 ! |
|
528 |
|
529 stopKeepAliveProcess |
|
530 |p| |
|
531 |
|
532 (p := keepAliveProcess) notNil ifTrue:[ |
|
533 keepAliveProcess := nil. |
|
534 p terminate |
|
535 ]. |
|
536 |
|
537 "Created: / 30-07-2013 / 09:15:05 / cg" |
445 ! ! |
538 ! ! |
446 |
539 |
447 !TerminalApplication methodsFor:'startup'! |
540 !TerminalApplication methodsFor:'startup'! |
|
541 |
|
542 startShellInSelectedWindow |
|
543 |vt| |
|
544 |
|
545 vt := self selectedWorkspacesTextView. |
|
546 (vt notNil and:[vt superView realized]) ifFalse:[ |
|
547 self window sensor pushUserEvent:#startShellInSelectedWindow for:self. |
|
548 ^ self. |
|
549 ]. |
|
550 |
|
551 vt startShellIn:initialDirectory. |
|
552 vt shellTerminateAction:[self shellFinishedInWorkspace:vt]. |
|
553 vt masterWindow:(self window). "/ to change window title |
|
554 |
|
555 "Modified: / 07-04-2011 / 09:03:55 / cg" |
|
556 "Modified: / 03-04-2012 / 10:31:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
557 ! ! |
|
558 |
|
559 !TerminalApplication methodsFor:'startup & release'! |
448 |
560 |
449 initialDirectory:aDirectory |
561 initialDirectory:aDirectory |
450 initialDirectory := aDirectory |
562 initialDirectory := aDirectory |
451 ! |
563 ! |
452 |
564 |
461 ! |
573 ! |
462 |
574 |
463 postOpenWith:aBuilder |
575 postOpenWith:aBuilder |
464 self startShellInSelectedWindow. |
576 self startShellInSelectedWindow. |
465 super postOpenWith:aBuilder |
577 super postOpenWith:aBuilder |
|
578 ! |
|
579 |
|
580 release |
|
581 self stopKeepAliveProcess. |
|
582 super release. |
|
583 |
|
584 "Created: / 30-07-2013 / 07:54:16 / cg" |
466 ! |
585 ! |
467 |
586 |
468 shellFinishedInWorkspace:aView |
587 shellFinishedInWorkspace:aView |
469 "/ vt backgroundColor:(Color red). |
588 "/ vt backgroundColor:(Color red). |
470 aView |
589 aView |
471 cr; |
590 cr; |
472 nextPutLine:('>> shell terminated.' asText allBold colorizeAllWith:Color red). |
591 nextPutLine:('>> shell terminated.' asText allBold colorizeAllWith:Color red). |
473 ! |
|
474 |
|
475 startShellInSelectedWindow |
|
476 |vt| |
|
477 |
|
478 vt := self selectedWorkspacesTextView. |
|
479 (vt notNil and:[vt superView realized]) ifFalse:[ |
|
480 self window sensor pushUserEvent:#startShellInSelectedWindow for:self. |
|
481 ^ self. |
|
482 ]. |
|
483 |
|
484 vt startShellIn:initialDirectory. |
|
485 vt shellTerminateAction:[self shellFinishedInWorkspace:vt]. |
|
486 vt masterWindow:(self window). "/ to change window title |
|
487 |
|
488 "Modified: / 07-04-2011 / 09:03:55 / cg" |
|
489 "Modified: / 03-04-2012 / 10:31:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
490 ! ! |
592 ! ! |
491 |
593 |
492 !TerminalApplication class methodsFor:'documentation'! |
594 !TerminalApplication class methodsFor:'documentation'! |
493 |
595 |
|
596 version |
|
597 ^ '$Header: /cvs/stx/stx/libtool/TerminalApplication.st,v 1.19 2013-07-30 09:02:01 cg Exp $' |
|
598 ! |
|
599 |
494 version_CVS |
600 version_CVS |
495 ^ '$Header: /cvs/stx/stx/libtool/TerminalApplication.st,v 1.13 2013-07-23 21:08:55 cg Exp $' |
601 ^ '$Header: /cvs/stx/stx/libtool/TerminalApplication.st,v 1.19 2013-07-30 09:02:01 cg Exp $' |
496 ! |
602 ! |
497 |
603 |
498 version_HG |
604 version_HG |
499 |
605 |
500 ^ '$Changeset: <not expanded> $' |
606 ^ '$Changeset: <not expanded> $' |